search
尋找貓咪~QQ 地點 桃園市桃園區 Taoyuan , Taoyuan

[ZF]Zend Framework GET & POST

在ZF中,只能在Controller中取得Post跟Get的值!

取得的方式是用$this->_request->get()及$this->_request->getPost()兩個方法

FooController

_request->get("act");
			$post = $this->_request->getPost("name");
			//or
			$test = $this->_request->getParam("test");
			$this->view->msg = "GET:" . $get . "  POST:" . $post;
			//取得POST陣列
			$post = $this->_request->getPost();
			//取得GET陣列(含controller、action、module)
			$get = $this->_request->getParams();

			//也可以使用Controller中取得參數的方法
			$request = $this->getRequest();
			if ($request->isPost()) {
				$param = $request->getParams();
			}
		}
	}
?>
Categories: PHPZendFramework



熱門推薦

本文由 blogjohnsonluorg 提供 原文連結

寵物協尋 相信 終究能找到回家的路
寫了7763篇文章,獲得2次喜歡
留言回覆
回覆
精彩推薦