container = $container; $this->helpers = new Container; } /** * Expose helpers with magic getter * * @access public * @param string $helper * @return mixed */ public function __get($helper) { return $this->getHelper($helper); } /** * Expose helpers with method * * @access public * @param string $helper * @return mixed */ public function getHelper($helper) { return $this->helpers[$helper]; } /** * Register a new Helper * * @access public * @param string $property * @param string $className * @return Helper */ public function register($property, $className) { $container = $this->container; $this->helpers[$property] = function() use ($className, $container) { return new $className($container); }; return $this; } }