Пример #1
0
 public function testDisplay()
 {
     ob_start();
     self::$render->display(array("render" => "display"));
     $out = ob_get_clean();
     $this->assertSame("It is render's function display", $out);
 }
Пример #2
0
 /**
  * Runtime execute template.
  *
  * @param array $values input values
  * @throws CompileException
  * @return Render
  */
 public function display(array $values)
 {
     if (!$this->_code) {
         // evaluate template's code
         eval("\$this->_code = " . $this->_getClosureSource() . ";\n\$this->_macros = " . $this->_getMacrosArray() . ';');
         if (!$this->_code) {
             throw new CompileException("Fatal error while creating the template");
         }
     }
     return parent::display($values);
 }