i am using the latest cakephp2. In one controller, i have multiple action.
For exemple
OrderController.php
public function save_1(){
//check validate of model and save
}
public function save_2(){
//check validate of model and save
}
In the model:
Order.php
public $validate = array(
'name' => array(
'rule' => 'notEmpty',
'message' => 'Please enter Name'
)
);
In the function save_1 of my controller, i need to check the name. That work.
But in the save_2 function, i have only to check the adress.
How can i make multiple validation with only 1 model ?
Thank you for your answer and sorry for my english ..
You can use Multivalidatable behavior in your model. Below is the link.
Thanks..!
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments