コード例 #1
0
 /**
  * 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);
 }
コード例 #2
0
 public function __construct(array $options = array())
 {
     parent::__construct($options);
     //Set the correct mime type
     $this->_document->setMimeEncoding('text/plain');
     $this->chart = new KChartOpenflashchart();
 }
コード例 #3
0
ファイル: template.php プロジェクト: raeldc/com_learn
 /**
  * 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
     );
 }
コード例 #4
0
ファイル: html.php プロジェクト: janssit/www.gincoprojects.be
 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);
 }
コード例 #5
0
 /**
  * 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);
 }
コード例 #6
0
 /**
  * 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;
 }
コード例 #7
0
ファイル: json.php プロジェクト: daodaoliang/nooku-framework
 /**
  * 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);
     }
 }
コード例 #8
0
ファイル: template.php プロジェクト: stonyyi/anahita
 /**
  * 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);
 }
コード例 #9
0
 /**
  * Constructor
  *
  * @param   object  An optional KConfig object with configuration options
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
     $this->set($config->toArray());
 }
コード例 #10
0
ファイル: json.php プロジェクト: janssit/www.gincoprojects.be
 public function __construct(array $options = array())
 {
     parent::__construct($options);
     //Set the correct mime type
     $this->_document->setMimeEncoding('application/json');
 }
コード例 #11
0
ファイル: feed.php プロジェクト: ravenlife/Ninja-Framework
 /**
  * Constructor
  *
  * @param 	object 	An optional KConfig object with configuration options
  */
 public function __construct(KConfig $config)
 {
     parent::__construct($config);
 }