arno arno - 1 year ago 117
Ajax Question

Zend getParams not returing url params

I have a query:


returns: NULL


returns: string(5) "arno"

How to fix this problem? I mean how to get GET values with zend framework?
Lets assume i can't change the query string.

zend version 1.11.11

public function usersearchajaxAction(){
$this->_helper->viewRenderer->setNoRender( true );

$userService = new Application_Services_User();

$userList = $userService->searchByName($this->_request->getParam('query'));
$this->_helper->json($userService->getArrayForAutoComplete($this->_request->getParam('query'), $userList));


I found the problem, there was and override of $_GET variable in my project.
So it is fix now. thank you all for reading and thinking about this

Answer Source

instead of


use this


there is no need to use request action helper in Action to get this params

or try to use this way which uses request action helper

$request  = $this->getRequest();
$query = $request->getParam('query');

hope this link will help you

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download