Jiew Meng Jiew Meng - 1 year ago 66
PHP Question

Zend Framework: Can i just get GET params?

In Zend Framework, most of the time to get a param, i will use

// from controller

but how can i get just GET params using the 'Zend' way? Or do i just use
? Is there any difference between




Answer Source

Use getQuery():


Other methods available include

  • getParam()
  • getQuery()
  • getPost()
  • getCookie()
  • getServer()
  • getEnv()

getParam() checks user params first, then $_GET, and then $_POST, returning the first match found or null.

Try to avoid accessing the superglobals directly.