我们应该如何将 zend view helper 表单与验证器一起使用 +过滤器?
我们应该如何将 zend view helper 表单与验证器 + 过滤器一起使用?
缺少来自以下验证器和过滤器的示例:http ://framework.zend.com/manual/en/zend.view.helpers.html
<form action="action.php" method="post">
<p>
<label>Your Email:
<?php echo $this->formText('email', '[email protected]', array('size' => 32)) ?>
</label>
</p>
<p>
<label>Your Country:
<?php echo $this->formSelect('country', 'us', null, $this->countries) ?>
</label>
</p>
<p>
<label>Would you like to opt in?
<?php echo $this->formCheckbox('opt_in', 'yes', null, array('yes', 'no')) ?>
</label>
</p>
</form>
谢谢,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将表单创建为单独的类,然后您可以使用您想要的所有验证器和过滤器。文档中有完整的设置信息:
http://framework.zend。 com/manual/en/zend.form.quickstart.html
文档示例:
Create the form as a separate class and then you can use all the validators and filters you wish. There's complete setup info in the docs:
http://framework.zend.com/manual/en/zend.form.quickstart.html
Example from docs: