If I include codings like this

class Phonebook extends AppModel
  {
     var $name = 'Phonebook';
         var $validate = array(
      'name' =>array (VALID_NOT_EMPTY => 'user name is required',
VALID_NAME => 'Name should contan Only Letters'),
      'mobileno' => VALID_NOT_EMPTY

         );
   }

in Phonebookmodels then it is displaying error message as

Warning: preg_match() expects parameter 1 to be string, array given in
C:\www\gadgets\cake\libs\model\model_php5.php on line 1348

In model_php5.php on line 1348 it contains the codings as follows,

foreach($this->validate as $field_name => $validator)
{
        if (isset($data[$field_name]) && !preg_match($validator,
$data[$field_name]))
         {
                $this->invalidate($field_name);
        }
}
return $this->validationErrors;

So i cannot send value as an array.How to solve this


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to