Hello Folks!

Imagine the following situation:

I create a validation rule on the controller, for example, like below:

$this->Person->validate = array(
        'Name' => array(
                'rule' => 'notEmpty',
                'message' => 'Some error text message here'
        )
);

In the view i have a form like this:

<?php print $form->input('Person.0.Name'); ?>
<?php print $form->input('Person.1.Name'); ?>

I don't want to save the data, just validate it. So, i do the
following at the controller:

$this->Person->set( $this->data );

$this->Person->validates() {
        //
}

However, the code above doesn't validates the data when it is a array
like:

Array(
        [0] => array(
                ['Name'] => 'Some Name'
        ),
        [1] => array(
                ['Name'] => 'Some Name'
        )
)

With $this->ControllerName->validates(), how can i validate a array
like happens when using $this->ModelName->saveAll().

Best Regards,

Felipe Carballo

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to