/** * 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) { if (isset($this->callback) && strlen($this->callback) > 0) { $config->padding = $state->callback; } } $this->_padding = $config->padding; }
/** * 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; // 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 default template paths $this->getTemplate()->addSearchPath(KConfig::unbox($config->template_paths)); //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()); }