a validation code has been created similar to ruby on rails
validation.
link--> 
http://bakery.cakephp.org/articles/view/rails-like-data-validation#comment-1127

Im having a problem in its helper... the isset($this-
>validationErrors[$model][$fieldName])
does not returns result even if i make the fields empty of something..
just to test the
error validation.

---------------------------------------------------------------------------------------------------------------------------------------------
class ErrorHelper extends Helper {
    function forField($field) {
        list($model,$fieldName) = explode('/',$field);
        if ( isset($this->validationErrors[$model][$fieldName]) ) ) {
            return '<div class="error">' . $this-
>validationErrors[$model][$fieldName] . '</div>';
        } else {
            return '';
        }
    }
}
---------------------------------------------------------------------------------------------------------------------------------------------

for example, i set a rule:

$this->validates_presence_of('username'); and run my code.. save it
without a value for
usename. it does return any because the isset($this-
>validationErrors[$model][$fieldName])
is null or empty. What's wrong with this? Can anyone help me.. Im
using version 1.1.15.XXXX


--~--~---------~--~----~------------~-------~--~----~
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