Phalcon Critaria:: formInput

i have the table itk_parselle(id_itk, id_parc) related with two table Parcelle(id_parc) and ITK( id_itk , nom , date....) I want to fill the form of ITK from itk_parselle but in ITKcontroller i msut make : $query = Criteria::fromInput($this->di, "Itk", $this->request->getpost()); and she dont accept
$query = Criteria::fromInput($this->di, "Itk_parcelle", $this->request->getpost() => erreur

how I can fill the ITK form from Itk_Parcelle.


Try using $_POST variable, also remove any variables in post that dont belong to the model in question.

$query = Criteria::fromInput($this->di, "Itk_parcelle", $_POST);


hy Rudi I tryed but i dont have a solution my table ITK_Parcelle(id_itk, id_parc) related with itk(id_itk,name, details, value delai ) and Parcelle(id_parc, name_parc.details) i want to fill the itk forms (name , details,delai ,value) from the model of itk_parcelle in the ITKactionController $query = Criteria::fromInput($this->di, "Itk_parcelle", $_POST); in the vieu : {% for ParcelleItk in page.items %} <td>{{ ParcelleItk.itk.getNomItk() }}</td> <td>{{ ParcelleItk.itk.getDateItk() }}</td> <td>{{ ParcelleItk.itk.getDureeHj() }}</td> <td>{{ "%.2f"|format( ParcelleItk.itk.getSurfItk()) }} m²</td> <td>{{ ParcelleItk.itk.getValeurItk() }}</td>

        the error is :   Notice: Undefined index: nom_itk in phalcon/mvc/model/criteria.zep on line 724 in C:\wamp\www\STC4\prod\app\controllers\ItkController.php on line 37

YOU cannot have KEYS in POST that do not match the model.