public function getParam($key, $default = null) { $value = $this->getRequest()->getParam($key); if ((null === $value || '' === $value) && null !== $default) { $value = $default; } return $value; }