예제 #1
0
 /**
  * Parse the template or if $section is set and the section exists, parse the specified section
  * @param string $section
  */
 public function parse($section = NULL)
 {
     $oldSearchpath = One_Script_Factory::getSearchPath();
     One_Script_Factory::clearSearchpath();
     One_Script_Factory::setSearchPath($this->getSearchPath());
     if ($this->useFile()) {
         $this->nScript->load($this->getFile());
         $this->nScript->select($section);
         if (!$this->nScript->isError()) {
             $output = $this->nScript->execute($this->getData());
         }
     } else {
         $this->nScript->select($section);
         $output = $this->nScript->executeString($this->getContent(), $this->getData());
     }
     One_Script_Factory::clearSearchpath();
     One_Script_Factory::setSearchPath($oldSearchpath);
     One_Script_Content_Factory::$nsContentCache = array();
     if ($this->nScript->isError()) {
         throw new One_Exception($this->nScript->error);
     }
     return trim($output);
 }
예제 #2
0
 public static function clearContentCache()
 {
     self::$nsContentCache = array();
 }