/** * Constructor * * @param object An optional KConfig object with configuration options */ public function __construct(KConfig $config) { parent::__construct($config); // set the auto assign state $this->_auto_assign = $config->auto_assign; // set the auto filter state $this->_auto_filter = $config->auto_filter; // set the default layout for the view $this->_layout_default = $config->layout_default; // user-defined escaping callback $this->setEscape($config->escape); // set the layout $this->setLayout($config->layout); // set the template object if (!empty($config->template)) { $this->setTemplate($config->template); } //Get the template object $template = $this->getTemplate()->setView($this); //Set the template filters if (!empty($config->template_filters)) { $template->addFilters($config->template_filters); } // Add default template paths if (!empty($config->template_path)) { $template->addPath($config->template_path); } // Set base and media urls for use by the view $this->assign('baseurl', $config->base_url)->assign('mediaurl', $config->media_url); //Add alias filter for media:// namespace $template->getFilter('alias')->append(array('media://' => $config->media_url . '/'), KTemplateFilter::MODE_READ | KTemplateFilter::MODE_WRITE); //Add alias filter for base:// namespace $template->getFilter('alias')->append(array('base://' => $config->base_url . '/'), KTemplateFilter::MODE_READ | KTemplateFilter::MODE_WRITE); }
public function __construct(array $options = array()) { parent::__construct($options); //Set the correct mime type $this->_document->setMimeEncoding('text/plain'); $this->chart = new KChartOpenflashchart(); }
/** * Constructor * * @param object An optional KConfig object with configuration options */ public function __construct(KConfig $config) { parent::__construct($config); // set the auto assign state $this->_auto_assign = $config->auto_assign; //set the data $this->_data = KConfig::toData($config->data); // user-defined escaping callback $this->setEscape($config->escape); // set the template object $this->_template = $config->template; //Set the template filters if(!empty($config->template_filters)) { $this->getTemplate()->addFilter($config->template_filters); } // Set base and media urls for use by the view $this->assign('baseurl' , $config->base_url) ->assign('mediaurl', $config->media_url); //Add alias filter for media:// namespace $this->getTemplate()->getFilter('alias')->append( array('media://' => $config->media_url.'/'), KTemplateFilter::MODE_READ | KTemplateFilter::MODE_WRITE ); //Add alias filter for base:// namespace $this->getTemplate()->getFilter('alias')->append( array('base://' => $config->base_url.'/'), KTemplateFilter::MODE_READ | KTemplateFilter::MODE_WRITE ); }
public function __construct($options = array()) { $options = $this->_initialize($options); // Add a rule to the template for form handling and secrity tokens KTemplateDefault::addRules(array(KFactory::get('lib.koowa.template.rule.form'))); // Set a base path for use by the view $this->assign('baseurl', $options['base_url']); parent::__construct($options); }
/** * Constructor * * @param KObjectConfig $config Configuration options */ public function __construct(KObjectConfig $config) { parent::__construct($config); //Set the auto fetch $this->_auto_fetch = $config->auto_fetch; //Set the layout $this->setLayout($config->layout); //Set the template object $this->setTemplate($config->template); }
/** * Constructor * * @param object An optional KConfig object with configuration options */ public function __construct(KConfig $config) { parent::__construct($config); //Padding can explicitly be turned off by setting to FALSE if (empty($config->padding) && $config->padding !== false) { $state = $this->getModel()->getState(); if (isset($state->callback) && strlen($state->callback) > 0) { $config->padding = $state->callback; } } $this->_padding = $config->padding; }
/** * Constructor * * @param KObjectConfig $config Configuration options */ public function __construct(KObjectConfig $config) { parent::__construct($config); $this->_version = $config->version; $this->_text_fields = KObjectConfig::unbox($config->text_fields); $this->_fields = KObjectConfig::unbox($config->fields); $query = $this->getUrl()->getQuery(true); if (!empty($query['fields'])) { $fields = explode(',', rawurldecode($query['fields'])); $this->_fields = array_merge($this->_fields, $fields); } }
/** * Constructor * * @param object An optional KConfig object with configuration options */ public function __construct(KConfig $config) { parent::__construct($config); //set the media url if (!$config->media_url instanceof KHttpUrl) { $this->_mediaurl = KService::get('koowa: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 = KConfig::unbox($config->data); // user-defined escaping callback $this->setEscape($config->escape); // set the template object $this->_template = $config->template; //Set the template filters if (!empty($config->template_filters)) { $this->getTemplate()->addFilter($config->template_filters); } //Add alias filter for media:// namespace $this->getTemplate()->getFilter('alias')->append(array('media://' => (string) $this->_mediaurl . '/'), KTemplateFilter::MODE_READ | KTemplateFilter::MODE_WRITE); }
/** * Constructor * * @param object An optional KConfig object with configuration options */ public function __construct(KConfig $config) { parent::__construct($config); $this->set($config->toArray()); }
public function __construct(array $options = array()) { parent::__construct($options); //Set the correct mime type $this->_document->setMimeEncoding('application/json'); }
/** * Constructor * * @param object An optional KConfig object with configuration options */ public function __construct(KConfig $config) { parent::__construct($config); }