Get a single value:
$this->params()->fromPost('paramname'); // From POST
$this->params()->fromQuery('paramname'); // From GET
$this->params()->fromRoute('paramname'); // From RouteMatch
$this->params()->fromHeader('paramname'); // From header
$this->params()->fromFiles('paramname'); // From file being uploaded
Default values:
All of these methods also support default values that will be returned if no parameter with the given name is found.
example:
$orderBy = $this->params()->fromQuery('orderby', 'name');
Get all parameters:
To get all parameters of one type, just don't pass in anything and the Params plugin will return an array of values with their names as keys
example:
$allGetValues = $this->params()->fromQuery(); // empty method call
Not using Params plugin
example:
$this->getRequest()->getRequest('name', 'default');
$this->getEvent()->getRouteMatch()->getParam('name', 'default');