我是 cakephp 新手,正在尝试在其中构建一个应用程序。我有一些文本字段,我希望对它们进行验证。我在 cakephp.org 中关注 cakephp 教程并执行了以下操作,但我在文本字段附近看不到验证消息。以下是我的代码:
cp:
<?php echo $this->Form->text('Rideoffer.PickFrom',
array('class' => 'address-text',
'value' => $dropFrom)); ?>
模型:
public $validate = array(
'PickFrom' => array(
'rule' => 'notEmpty',
'message' => 'Cannot leave this field blank.'
),
//'PickFrom' => 'notEmpty',
'DropAt' => 'notEmpty',
// 'born' => 'date'
);
我哪里错了?我该如何解决?