예제 #1
0
파일: View.php 프로젝트: hofmeister/Pimple
 private function parseTemplate()
 {
     $cachename = $this->getCacheName();
     $serializedName = $cachename . '.serialized';
     umask(02);
     $cache = Settings::get(View::CACHE, true);
     $parsed = null;
     if (!$cache || !is_file($cachename) || !is_file($serializedName)) {
         $phtml = file_get_contents($this->getTemplateFile());
         $parser = new Phtml();
         $parsed = $parser->read($phtml, $this->getTemplate());
         Dir::ensure(dirname($cachename));
         file_put_contents($serializedName, serialize($parsed));
         $parsed->toPhp($cachename);
     }
     return $parsed;
 }
예제 #2
0
<?php
define('BASEURL',dirname($_SERVER['SCRIPT_NAME']).'/');
require_once '../bootstrap.php';

$phtml = new Phtml();
//echo '<pre>';
//$phtml->setDebug(true);
$node = $phtml->read(file_get_contents('phtml.php'));
//echo '</pre>';
highlight_string($node->toPHP());