Bind GET params to a Form in Zend Framework
Jan 22nd, 2016 at 12:12pm
The equivalent of this for POST data is widely documented but for GET parameters you use the $request->getQuery method as below:
$request = $this->getRequest();
$form = $this->getServiceLocator()->get('FormElementManager')->get('FooForm');
$form->setData($request->getQuery());
et voila.
About
Fullstack developer.
Generate and run this codebase locally with one command:
bdcli qs -cb=mycoolblog -tpl=elib-blog
See empathy.sh.
Category
- Tech
- Photography
- Music
- Other
- Any