我已经验证了下面代码中的字母字段,但它不起作用..
<?php
class User extends AppModel {
public $name = 'User';
public $displayField = 'name';
public $validate = array(
'firstname'=>array(
'Please enter your firstname.'=>array(
'rule'=>'[a-zA-Z]+',
'message'=>'Please enter your firstname.'
)
),
?>
有人可以帮助吗
答案 0 :(得分:0)
你还没有结束你的阵列和你的课程,这很可能是个问题。
<?php
class User extends AppModel {
public $name = 'User';
public $displayField = 'name';
public $validate = array(
'firstname'=>array(
'Please enter your firstname.'=>array(
'rule'=>'[a-zA-Z]+',
'message'=>'Please enter your firstname.'
)
)
);
}
?>