当前位置: 动力学知识库 > 问答 > 编程问答 >

cakephp - get validationDefault from model in CakePHP3

问题描述:

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');
分享给朋友:
您可能感兴趣的文章:
随机阅读: