Example #1
0
 /**
  * CTOR
  * @param array $data
  */
 function __construct($data = array())
 {
     parent::__construct($data);
     $this->_extension = 'phtml';
     self::$_viewsPath = Maestro::gi()->get('app path') . '/views';
     $this->raw = false;
 }
Example #2
0
 /**
  * Load a renderer of a given type - acts as a getter if no param given
  * Returns self if no param
  * @param string|null $type
  * @throws \Exception
  * @return Renderer|self
  */
 public function renderer($type = null)
 {
     if ($type === null) {
         return $this->_renderer;
     }
     $class = Renderer::ClassFactory($type);
     if (null === $class) {
         throw new \Exception('Maestro\\Response::renderer() - Specified Renderer [' . $type . '] does not exist');
     }
     if (!$this->_renderer instanceof $class) {
         $this->_renderer = new $class();
     }
     return $this;
 }