public function __construct($template = null, $view = null, $partials = null)
 {
     // Use an object of an arbitrary class as a View for this Mustache instance:
     $view = new StdClass();
     $view->name = 'ilmich';
     $view->data = array(array('name' => 'federica', 'age' => 27, 'gender' => 'female'), array('name' => 'marco', 'age' => 32, 'gender' => 'male'));
     $partials = array('children' => "{{#data}}{{name}} - {{age}} - {{gender}}\n{{/data}}");
     parent::__construct($template, $view, $partials);
 }
 public function __construct()
 {
     parent::__construct();
     $this->parent_contexts[] = array('parent_id' => 'parent1', 'child_contexts' => array(array('child_id' => 'parent1-child1'), array('child_id' => 'parent1-child2')));
     $parent2 = new stdClass();
     $parent2->parent_id = 'parent2';
     $parent2->child_contexts = array(array('child_id' => 'parent2-child1'), array('child_id' => 'parent2-child2'));
     $this->parent_contexts[] = $parent2;
 }
Exemple #3
0
 public final function __construct($template = null, $view = null, $partials = null)
 {
     parent::__construct($template, $view, $partials);
     $this->_charset = Kohana::$charset;
     $this->base_url = JURI::base(TRUE);
     // Convert partials to expanded template strings
     foreach ($this->_partials as $key => $partial_template) {
         if ($location = Kohana::find_file('tmpl', $partial_template, 'mustache')) {
             $this->_partials[$key] = file_get_contents($location);
         }
     }
     $this->initialize();
     $this->fetch_template($template);
 }
Exemple #4
0
 public function __construct($flexi)
 {
     parent::__construct(file_get_contents($flexi->_template), $flexi->_attributes);
     $this->_flexi = $flexi;
 }
Exemple #5
0
 /**
  * KOstache class constructor.
  *
  * This method accepts a $template string and a $view object. Optionally, pass an associative
  * array of partials as well.
  *
  * @access public
  * @param string $template (default: null)
  * @param mixed $view (default: null)
  * @param array $partials (default: null)
  * @return void
  */
 public function __construct($template = null, $view = null, $partials = null)
 {
     parent::__construct($template, $view, $partials);
     $this->_charset = Kohana::$charset;
 }
Exemple #6
0
 public function __construct()
 {
     date_default_timezone_set('UTC');
     $this->helper = new LemmyHelper();
     parent::__construct();
 }
 public function __construct($template = null, $view = null, $partials = null)
 {
     $this->wrap = array($this, 'wrapWithEm');
     parent::__construct($template, $view, $partials);
 }