Example #1
0
 /**
  * Set the template content from a string
  *
  * @param  string  $source  The template source
  * @return KTemplateEngineMustache
  */
 public function loadString($source)
 {
     parent::loadString($source);
     //Let mustache load the source by proxiing through the load() method.
     $this->_mustache_template = $this->_mustache->loadTemplate($source);
     //Push the template on the stack
     array_push($this->_stack, array('url' => ''));
     return $this;
 }
Example #2
0
 /**
  * Set the template content from a string
  *
  * @param  string  $content  The template content
  * @return KTemplateEngineTwig
  */
 public function loadString($content)
 {
     parent::loadString($content);
     //Let twig load the content by proxiing through the getSource() method.
     $this->_twig_template = $this->_twig->loadTemplate($content);
     //Push the template on the stack
     array_push($this->_stack, array('url' => ''));
     return $this;
 }