我是cakephp的新手。我创建了一个表单来添加用户。我想只允许用户名字符。我的验证代码如下:
public $validate = array(
"username" => array(
"required" => array(
"rule" => array("notEmpty"),
"message" => "Name is required"
)
),
"age" => array(
"required" => array(
"rule" => array("notEmpty"),
"message" => "Age is required"
)
)
);
我应该添加什么才能只允许用户名字符。
答案 0 :(得分:0)