Hi,
thanks, this works for me except the problem that I get this error
message:
Do you know why this is happening?
Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the
right syntax to use near '_validationRules' at line 1 [COREcake/libs/
model/datasources/dbo_source.php, line 684]Code | Context
$out = null;
if ($error) {
trigger_error('<span style="color:Red;text-
align:left"><b>' . __('SQL Error:', true) . "</b> {$this->error}</
span>", E_USER_WARNING);$sql = "_validationRules"
$error = "1064: You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to
use near '_validationRules' at line 1"
$out = nullDboSource::showQuery() - COREcake/libs/model/datasources/
dbo_source.php, line 684
DboSource::execute() - COREcake/libs/model/datasources/dbo_source.php,
line 266
DboSource::fetchAll() - COREcake/libs/model/datasources/
dbo_source.php, line 410
DboSource::query() - COREcake/libs/model/datasources/dbo_source.php,
line 364
Model::call__() - COREcake/libs/model/model.php, line 502
Overloadable::__call() - COREcake/libs/overloadable_php5.php, line 50
Contact::_validationRules() - APP/app_model.php, line 39
AppModel::__construct() - APP/app_model.php, line 39
Contact::__construct() - APP/models/contact.php, line 15
ClassRegistry::init() - COREcake/libs/class_registry.php, line 141
Controller::loadModel() - COREcake/libs/controller/controller.php,
line 637
Controller::constructClasses() - COREcake/libs/controller/
controller.php, line 493
Dispatcher::_invoke() - COREcake/dispatcher.php, line 186
Dispatcher::dispatch() - COREcake/dispatcher.php, line 171
[main] - APP/webroot/index.php, line 88Query: _validationRules
On 14 Okt., 05:00, "Dr. Loboto" <[email protected]> wrote:
> http://book.cakephp.org/view/1230/Localization-in-CakePHP
>
> Reload invalidate() method.
>
> On 13 ÏËÔ, 18:38, heohni <[email protected]> wrote:
>
>
>
> > Hi,
>
> > I have this in my app_model.php
> > public $validate = array();
>
> > š š public function __construct($id = false, $table = null, $ds =
> > null) {
> > š š š š parent::__construct($id, $table, $ds);
>
> > š š š š $this->_validationRules();
> > š š }
>
> > And this way I have my model
> > unction _validationRules() {
> > š š š š $this->validate = array(
> > š š š š š š 'name' => array(
> > š š š š š š š š 'rule' => 'notEmpty',
> > š š š š š š š š 'message' => __('Name can not be empty', true)
> > š š š š š š ),
>
> > I have a .po file and translated all these strings.
>
> > The project works perfect when I switch the languages, just not for
> > the validation error.
>
> > Has anyone any ideas?
--
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