Beispiel #1
0
 /**
  * @expectedException     \RuntimeException
  * @expectedExceptionMessage template error
  */
 public function testFetchException()
 {
     $render = new Render(Fenom::factory("."), function () {
         echo "error";
         throw new \RuntimeException("template error");
     }, array("name" => "render.tpl"));
     $render->fetch(array());
 }
Beispiel #2
0
 /**
  * Add depends
  * @param Render $tpl
  */
 public function addDepend(Render $tpl)
 {
     $this->_depends[$tpl->getScm()][$tpl->getBaseName()] = $tpl->getTime();
 }
 /**
  * @param Fenom\Render $templateInstance
  */
 protected function cacheCheck(Fenom\Render $templateInstance)
 {
     $timeCompiled = $templateInstance->getTime();
     if (time() > $timeCompiled + self::CACHE_TTL * 30) {
         $this->clearCache();
     }
 }