Home » » cakephp multilingual validation

cakephp multilingual validation

Written By 1 on Monday, September 5, 2011 | 8:35 PM

cakephp multilingual  validation



Website which is multilingual, messages will be also multilingual. To set the different message follow the below some simple steps.

Paste following code in app_model.php
Code:
        function invalidate($field, $value = null) { 

        if (!is_array($this->validationErrors)) {

            $this->validationErrors = array();

        }

        if(empty($value)) {

            $value = true;

        }

        $this->validationErrors[$field] = __($value,  true);        

    }

field collation in database must be "utf8_unicode_ci"    

0 Comment:

Post a Comment