我使用的帐户控制器没有自己的表,但使用用户模型。Cakephp验证
所有工作正常,除非 - 当我验证任何形式。它说,验证失败(当我尝试失败的验证检查),但犯规扔场下面的错误
查看
<?php echo $this->Form->input('id'); ?>
<label for="UserPassword">New Password:</label>
<?php echo $this->Form->text('password', array('type' => 'password', 'value' => 'harsha')); ?><em>Password must be min 6 characters.</em> <?php echo $form->error('password'); ?>
控制器动作
if($this->User->saveField('password', $this->data['User']['password'], array('validate' => 'first'))) {
$this->Session->setFlash('Password has been changed.', 'flash-success');
} else {
$this->Session->setFlash('There was some problem with our system. Please try after some time.', 'flash-warning');
}