问题描述:

I try to make a JsValidate helper, then I need access to validationDefault wrote on my Models table.php, how I can access?

I try

$model = TableRegistry::get($model);

$rules = $model->validationDefault();

but don't work.

I use CakePHP 3.0 ( PHP 5.5 )

网友答案:

You get the validation object by doing:

$rules = $table->validator('default');
相关阅读:
Top