but in CFormModel controllers type (for example LoginForm) Where is validate() method used? i mean which method would call it in CFormModel controllers?
You would call it to ensure that the user’s input passes the rules you’ve specified in your rules() method. Your action will contain code that looks something like this:
$model = new YourFormModel;
if (isset($_POST['YourFormModel']))
{
$model->attributes = $_POST['YourFormModel'];
if ($model->validate())
{
// Set a flash message / redirect etc here
}
}