Ejemplo n.º 1
0
 /**
  * render
  *
  * @see \dirp\view::_render
  * @param array $params
  * @return string
  */
 public function render(array $params = null)
 {
     if ($params) {
         parent::merge_params($params);
     }
     return static::_render($this->_path, parent::get_params());
 }
Ejemplo n.º 2
0
 /**
  * __construct
  *
  * @param string $name
  * @param array $params
  */
 public function __construct($name, array $params = null)
 {
     $this->_name = $name;
     parent::__construct($params);
 }
Ejemplo n.º 3
0
 /**
  * __get
  * decorates \dirp\helper::__get to fetch instance
  * data on demand, as opposed to using one big array
  * in the __construct call, which would mean a large
  * overhead for every loaded file.
  *
  * known parameters are mapped to their correct SplFileInfo
  * method, while everything else works as expected.
  *
  * @param string $name
  * @return mixed
  */
 public function __get($name)
 {
     // custom case for this extension's icon:
     if ($name == 'icon' && parent::__get('icon') === null) {
         parent::__set('icon', $this->_get_icon());
     } elseif (parent::__get($name) === null) {
         if (isset(static::$_map[$name])) {
             parent::__set($name, call_user_func(array($this->_instance, static::$_map[$name])));
         }
     }
     return parent::__get($name);
 }