Example #1
0
 /**
  * Constructor
  *
  * @param   object  An optional ObjectConfig object with configuration options
  */
 public function __construct(ObjectConfig $config)
 {
     parent::__construct($config);
     //Set the media url
     if (!$config->media_url instanceof HttpUrlInterface) {
         $this->_mediaurl = $this->getObject('lib:http.url', array('url' => $config->media_url));
     } else {
         $this->_mediaurl = $config->media_url;
     }
     //Set the auto assign state
     $this->_auto_assign = $config->auto_assign;
     //Set the data
     $this->_data = ObjectConfig::unbox($config->data);
     //Set the user-defined escaping callback
     $this->setEscape($config->escape);
     //Set the layout
     $this->setLayout($config->layout);
     //Set the template object
     $this->_template = $config->template;
     //Attach the template filters
     $filters = (array) ObjectConfig::unbox($config->template_filters);
     foreach ($filters as $key => $value) {
         if (is_numeric($key)) {
             $this->getTemplate()->attachFilter($value);
         } else {
             $this->getTemplate()->attachFilter($key, $value);
         }
     }
     //Add alias filter for media:// namespaced
     $this->getTemplate()->getFilter('alias')->addAlias(array('media://' => (string) $this->_mediaurl . '/'), TemplateFilter::MODE_COMPILE | TemplateFilter::MODE_RENDER);
 }
Example #2
0
 /**
  * Constructor
  *
  * @param  ObjectConfig $config  An optional ObjectConfig object with configuration options
  */
 public function __construct(ObjectConfig $config)
 {
     parent::__construct($config);
     foreach ($config->toArray() as $key => $value) {
         $this->{$key} = $value;
     }
 }
Example #3
0
 public function __construct($path)
 {
     parent::__construct();
     try {
         $this->_setFile($path);
     } catch (\Exception $e) {
         die($e->getMessage());
     }
 }
Example #4
0
 /**
  * Constructor
  *
  * @param   ObjectConfig $config Configuration options
  */
 public function __construct(ObjectConfig $config)
 {
     parent::__construct($config);
     //Set the layout
     $this->setLayout($config->layout);
     //Set the template object
     $this->setTemplate($config->template);
     //Fetch the view data before rendering
     $this->addCommandCallback('before.render', '_fetchData');
 }
Example #5
0
 /**
  * Constructor
  *
  * @param   ObjectConfig $config Configuration options
  */
 public function __construct(ObjectConfig $config)
 {
     parent::__construct($config);
     $this->_version = $config->version;
     $this->_text_fields = ObjectConfig::unbox($config->text_fields);
     $this->_fields = ObjectConfig::unbox($config->fields);
     $query = $this->getUrl()->getQuery(true);
     if (!empty($query['fields']) && is_array($query['fields'])) {
         foreach ($query['fields'] as $type => $list) {
             if (!isset($this->_fields[$type])) {
                 $this->_fields[$type] = array();
             }
             $this->_fields[$type] = explode(',', rawurldecode($list));
         }
     }
     $this->addCommandCallback('before.render', '_convertRelativeLinks');
 }
 /**
  * Constructor
  *
  * @param   object  An optional ObjectConfig object with configuration options
  */
 public function __construct(ObjectConfig $config)
 {
     parent::__construct($config);
     //Set the auto assign state
     $this->_auto_assign = $config->auto_assign;
     //Set the data
     $this->_data = ObjectConfig::unbox($config->data);
     //Set the layout
     $this->setLayout($config->layout);
     //Set the template object
     $this->_template = $config->template;
     //Attach the template filters
     $filters = (array) ObjectConfig::unbox($config->template_filters);
     foreach ($filters as $key => $value) {
         if (is_numeric($key)) {
             $this->getTemplate()->attachFilter($value);
         } else {
             $this->getTemplate()->attachFilter($key, $value);
         }
     }
 }
Example #7
0
 /**
  * Constructor
  *
  * @param  ObjectConfig $config An optional ObjectConfig object with configuration options
  */
 public function __construct(ObjectConfig $config)
 {
     parent::__construct($config);
     $this->_version = $config->version;
 }