我记得用过类似的东西
$this->getRequest()->isPost()
Run Code Online (Sandbox Code Playgroud)
但似乎没有这样的功能.如何检查请求是否发布,以便我可以验证表单等
Max*_*nce 41
$this->getRequest()在控制器的上下文中注释为返回类的对象Zend_Controller_Request_Abstract.isPost()是一种Zend_Controller_Request_Http从中衍生出来的方法Zend_Controller_Request_Abstract.
所以你的IDE不能提供这种方法,但它就在那里.
Kde*_*com 16
if ($this->getRequest()->isPost())
{
echo "this is post request";
}
else
{
echo "this is not the post request";
}
Run Code Online (Sandbox Code Playgroud)
if($this->getRequest()->getMethod() == 'POST') {
echo "You've got post!";
}
Run Code Online (Sandbox Code Playgroud)
isPost()也应该在那里,但我不知道为什么你找不到它.
| 归档时间: |
|
| 查看次数: |
28399 次 |
| 最近记录: |