下面的方法如何工作?$this->getRequest()->getPost();类Zend_Controller_Request_Abstract中没有方法getPost(),但它是如何工作的呢?在OOP原则中,方法getPost()应该出现在Zend_Controller_Request_Abstract中。如果没有直接实例,Zend如何在Zend_Controller_Request_Http类中拉取getPost()?谢谢。 最佳答案 Zend将首先将您的所有请求发送到FrontController,它位于Zend/Cont
publicfunctionprocess(Zend_Controller_Request_Abstract$request){$this->first_name=$this->sanitize($request->getPost('first_name'));....}我的问题是$request是类zend_controller_request_abstract的一个实例,但是getpost是类zend_controller_request_http中定义的一个函数,它扩展了zend_controller_request_abstract,那为什么$request直接调用getPos
假设我有$_POST["x"]["y"]=5;我怎么能Yii::app()->request->getPost('x[y]');如何通过索引检索post变量?是否有任何检查sql注入(inject)的yii函数?getPost会做那个检查吗?谢谢。 最佳答案 我对yii不熟悉,但是在看函数的源码https://github.com/yiisoft/yii/blob/1.1.12/framework/web/CHttpRequest.php你会的$x=Yii::app()->request->getPost('x');$y=$x['y