Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 /**
  * Constructor
  * 
  * @param	array An optional associative array of configuration settings.
  */
 public function __construct(array $options = array())
 {
     // Initialize the options
     $options = $this->_initialize($options);
     // Mixin the KMixinClass
     $this->mixin(new KMixinClass($this, 'View'));
     // Assign the classname with values from the config
     $this->setClassName($options['name']);
     // set the charset (used by the variable escaping functions)
     $this->_charset = $options['charset'];
     // user-defined escaping callback
     $this->setEscape($options['escape']);
     // Set a base path for use by the view
     $this->_basePath = $options['base_path'];
     // set the default template search path
     if ($options['template_path']) {
         // user-defined dirs
         $this->setTemplatePath($options['template_path']);
     } else {
         $this->setTemplatePath($this->_basePath . DS . 'tmpl');
     }
     // assign the document object
     if ($options['document']) {
         $this->_document = $options['document'];
     } else {
         $this->_document = KFactory::get('lib.joomla.document');
     }
     // set the layout
     $this->setLayout($options['layout']);
     //Register the view stream wrapper
     KTemplateDefault::register();
     KTemplateDefault::addRules($options['template_rules']);
     //Add the include paths for the helpers
     KViewHelper::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_' . $this->getClassName('prefix') . DS . 'helpers');
 }