Ubiquity  2.0.2
php rapid development framework
MicroTemplateEngine.php
Go to the documentation of this file.
1 <?php
2 
4 
7 
9  private $viewsFolder;
10 
11  public function __construct() {
12  $this->viewsFolder=ROOT . DS . "views/";
13  }
14 
15  /*
16  * (non-PHPdoc)
17  * @see TemplateEngine::render()
18  */
19  public function render($viewName, $pData, $asString) {
20  $config=Startup::getConfig();
21  $fileName=$this->viewsFolder . $viewName;
22  if (is_array($pData)) {
23  extract($pData);
24  }
25  $tpl=new TemplateParser($fileName);
26  $content=eval('?>' . $tpl->__toString());
27  if ($asString)
28  return $content;
29  else
30  echo $content;
31  }
32 }
Moteur de template pour les fichiers d&#39;extension phtml.