Daily Archives: February 10, 2014

Zend Framework 2: Get Parameters

The easiest way to do that would be to use the Params plugin, introduced in beta5. It has utility methods to make it easy to access different types of parameters. As always, reading the tests can prove valuable to understand how something is supposed to be used. Get a single value To get the value of a named parameter in a controller, you will need to select the appropriate method for the type of parameter you are looking for and pass in the name. Default values All of these methods also support default values that will be returned if no parameter with the given name is found. When visiting http://example.com/?orderby=birthdate, $orderBy will have the value birthdate.When visiting http://example.com/, $orderBy will have the default value name. Get all parameters To get all parameters of…

Continue Reading
Contact Us
  • Nanyang Technological University, Singapore
  • root [at] haozhexie [dot] com