We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

problem with submit

hi guys I try to create new form but it doesn't post my input values, the only thing I can see after submiting the form is the form herself :( any idea ?! (even if i make dump and echo to see what happens in controller)



58.4k

Hey guy

You can upload code ?



5.8k
edited Mar '15

good morning Thien,

    $dataclient->add('NumSocietaire', $this->request->getPost("numSoc"));
    $dataclient->add('NomSociete', $this->request->getPost("nomSoc"));
    $dataclient->add('NomAbrege', $this->request->getPost("nomAbrg"));
    $dataclient->add('NumIdentificationFiscale', $this->request->getPost("NumIdFisc"));
    $dataclient->add('NumPatente', $this->request->getPost("numPatente"));
    $dataclient->add('CodeActivite', $this->request->getPost("activite"));
    $dataclient->add('VIP', $this->request->getPost("vip"));
    $dataclient->add('TypeVIP', $this->request->getPost("typeVip"));
    $dataclient->add('IdIntermediaire', $this->request->getPost("intermediaire"));
    $Adresse = $this->request->getPost("ligneAdrs");
    $CodePostal = $this->request->getPost("codePostal");
    $TypeAdresse = $this->request->getPost("typeAdrs");

    $ville = $this->request->getPost("villeT");

    $NomContact = $this->request->getPost('nomContact');
    $PrenomContact = $this->request->getPost('prenomContact');
    $NumPortable = $this->request->getPost('portableContact');
    $NumFixe = $this->request->getPost('fixeContact');
    $AdresseMail = $this->request->getPost('mailContact');
    $Fonction = $this->request->getPost('fonction');

    $data->add("NomInterlocuteur", $this->request->getPost('nomInterloc'));
    $data->add("PrenomInterlocuteur", $this->request->getPost('prenomInterloc'));
    $data->add("NumPortable", $this->request->getPost('portableInterloc'));
    $data->add("NumFixe", $this->request->getPost('fixeInterloc'));
    $data->add("NumFax", $this->request->getPost('faxInterloc'));
    $data->add("Email", $this->request->getPost('emailInterloc'));

    $CodeBanque = $this->request->getPost('codeBnq');
    $CodeAgenceBancaire = $this->request->getPost('codeAgBnq');
    $NumeroCompteBancaire = $this->request->getPost('numCmptBnq');
    $RIB = $this->request->getPost('rib');
    echo $this->request->getPost("numSoc");
    var_dump($dataclient->get());


5.8k

and for DataArray class :

    class DataArray{

private $array;

public function __construct() {
    $this->array = array();
}
public function add($name, $value, $type=null){     
    if(!is_null($value) && $value != ''){
        switch($type){
            case 'string' :
                //$this->array[$name] = array(strtoupper(str_replace("'","''",addslashes($value))), $type);
                $this->array[$name] = array(strtoupper(str_replace("'","''",$value)), $type);
                break;
            case 'fk_key' :
                if( $value != 0)
                {
                    $this->array[$name] = array($value, $type);                    
                }
                break;
            case 'int' :
                $this->array[$name] = array($value,$type);    
                break;
            case 'money' :
                $this->array[$name] = array($value,$type);    
                break;
            default :
                $this->array[$name] = array(strtoupper(str_replace("'","''",$value)), $type);
        }
    }
}

public function get(){
    return $this->array;
}  
}


5.8k

Problem solved, I used to call my action with the same name of view, this is why phalcon didn't know it. I created a new action with different name and I make my old one empty then I submit via new action.