/** * Gets a state value (from Input if value is set, or from Session, if value is not set) * * @param string $key The name of the param * @param mixed|GetterInterface $default [optional] Default value, or, if instanceof GetterInterface, parent GetterInterface for the default value * @param string|array $type [optional] default: null: raw. Or const int GetterInterface::COMMAND|GetterInterface::INT|... or array( const ) or array( $key => const ) * @return string|array * * @throws \InvalidArgumentException If $key has a namespace/ in it. */ public function get($key, $default = null, $type = null) { if ($this->input->has($key)) { $value = $this->input->get($key, $default, $type); $this->set($key, $value); return $value; } return $this->session->get($this->sessionKeyPrefix . $key, $default, $type); }