【发布时间】:2010-10-27 09:47:18
【问题描述】:
我正在使用一个没有自己的表但使用用户模型的帐户控制器。
除了验证任何表单时,一切正常。它说验证失败(当我尝试验证检查失败时)但不会在字段下方抛出错误
查看
<?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');
}
【问题讨论】:
标签: cakephp validation cakephp-1.3