Dinamic rule validation |
hi ,sorry for english ,i have several couple of file everyone size_1 quantity_1 size_2
quantity_2 ecc the field become to a db's table . how can i set roule dinamicalii , now my roules are [CODE] $rules= [ 'idSize_1'=>[ 'rules'=>'check_size_quantity[idSize1,idQuantity1]', 'errors'=> 'check_size_quantity'=>'You must enter both size and quantity of field XXXX ' ] ], ]; [/CODE ] how can i do this dinamically ? how can i set xxx as field name ?
this is my $_POST
Code: Array ( [id_sessioni_ordini] => 3 [nomeCapoAbbigliamento_1] => T-shirt [idCapoAbbigliamento_1] => [taglia_1] => 2 [quantita_1] => 3 [nomeCapoAbbigliamento_2] => Felpa [idCapoAbbigliamento_2] => [taglia_2] => [quantita_2] => [nomeCapoAbbigliamento_3] => Pile [idCapoAbbigliamento_3] => [taglia_3] => 3 [quantita_3] => 2 [nomeCapoAbbigliamento_4] => Pantalone lungo [idCapoAbbigliamento_4] => [taglia_4] => [quantita_4] => ) Code: $post = $this->request->getPost(); Code: /** |
Welcome Guest, Not a member yet? Register Sign In |