0
在查看显示的错误消息我需要显示在查看如何使用尔康
以下错误消息是我的代码:
这是我的表单代码:
public function initialize() {
$name = new Text('name', array(
'class' => 'form-control',
"placeholder" => "Type your name"
));
$name->addValidators(array(
new PresenceOf(array(
'message' => 'Please enter your username.',
)),
));
$this->add($name);
}
这里是我的HTML代码:
<form method="post" action="user">
<p>
<label>
Name
</label>
<?php echo $userForm->render("name"); ?>
</p>
<p>
<input type="submit" value="Save" />
</p>
</form>
这里是我的控制文件中的代码:
public function indexAction()
{
$userform = new UserForm();
$this->view->userForm = $userform;
if($this->request->isPost()) {
if($userform->isValid($_POST)) {
}
}
}
任何帮助,非常感谢。 在此先感谢。