/** * Magic accessor for helpers. Provides access to attributes that were deprecated. * * @param string $name Name of the attribute to get. * @return mixed */ public function __get($name) { switch ($name) { case 'base': case 'here': case 'webroot': case 'data': return $this->request->{$name}; case 'action': return $this->request->params['action']; case 'params': return $this->request; case 'output': return $this->Blocks->get('content'); } if (isset($this->Helpers->{$name})) { $this->{$name} = $this->Helpers->{$name}; return $this->Helpers->{$name}; } return $this->{$name}; }
/** * Magic accessor for helpers. Provides access to attributes that were deprecated. * * @param string $name Name of the attribute to get. * @return mixed */ public function __get($name) { if (isset($this->Helpers->{$name})) { return $this->Helpers->{$name}; } switch ($name) { case 'base': case 'here': case 'webroot': case 'data': return $this->request->{$name}; case 'action': return isset($this->request->params['action']) ? $this->request->params['action'] : ''; case 'params': return $this->request; case 'output': return $this->Blocks->get('content'); default: return $this->{$name}; } return null; }