Sunulduğu gibi, zend controller's documentation page bu gibi parametreleri alabilirsiniz:
public function userinfoAction()
{
$request = $this->getRequest();
$username = $request->getParam('username');
$username = $this->_getParam('username');
}
Ayrıca request documentation bildiren dikkat etmelisiniz:
Onun bazı iş yapmak için, getParam()
aslında çeşitli kaynaklardan alır. Öncelik sırasına göre, bu aşağıdakileri içerir: setParam()
, GET
parametreleri ve son olarak POST
parametreler ile ayarlanır kullanıcı parametreleri. Bu yöntemle veri çekerek bu farkında olun.
If you wish to pull only from parameters you set via setParam()
, use the getUserParam()
.
Additionally, as of 1.5.0, you can lock down which parameter sources will be searched. setParamSources()
allows you to specify an empty array or an array with one or more of the values '_GET' or '_POST' indicating which parameter sources are allowed (by default, both are allowed); if you wish to restrict access to only '_GET' specify setParamSources(array('_GET'))
.