【发布时间】:2012-04-01 06:43:52
【问题描述】:
我正在我的 ZF 应用程序中创建一个简单的联系表单。只为几个表单元素操作装饰器感觉不值得。
我的问题是:我是否仍然可以对使用 Zend Form 创建的非元素使用 Zend Form Filters:
例如:
形式:
<!-- Standard HTML - not generated with ZF -->
<form id="contact-form" method="post" action="/contact/submit">
<input type="text" name="name" />
<input type="email" name="email" />
<input type="submit" name="submit" />
</form>
控制器:
public function submitAction()
{
$params = $this->_request->getParams();
//Am I able to apply filters/validators to the data I get from the request?
//What is the best way to handle this?
}
我查看了this(Darcy Hastings 的回答)——它似乎可以工作,只是感觉有点 hacky。
任何和所有建议都表示赞赏。
谢谢, 肯
【问题讨论】:
-
我同意,我也不喜欢 Darcy Hastings 的回答。
标签: html forms zend-framework zend-form