On Apr 9, 1:09 pm, stefanb <[EMAIL PROTECTED]> wrote:
> How can I translate the error messages in validate arrays?
>
> example:
>
> <?php
> public $validate = array(
>
> 'name' => array(
> 'validtext' => array('rule' =>
> array('validTitle', 'name'),
> 'message' => 'Not a
> valid name, you fool!'),
> 'between' => array('rule' =>
> array('between', 3, 32),
> 'message' => 'Must be
> between 3 and 32 characters long')),
> 'description' => array('rule' => array('validText',
> 'description'),
> 'message' => 'Not a valid
> description, you fool!'),
> 'url' => array('rule' => 'url',
> 'required' => false,
> 'allowEmpty' => true,
> 'message' => 'Not a valid URL'));
> ?>
Set the $validate in __construct() so that you can use __()
method. Refer http://groups.google.com/group/cake-php/web/frequent-discussions
--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---