Exemplo n.º 1
0
 /**
  * Return cached content
  *
  * @param Smarty_Internal_Template $_template template object
  *
  * @return null|string
  */
 public function getCachedContent(Smarty_Internal_Template $_template)
 {
     if (!isset($_template->cached)) {
         $_template = Smarty_Template_Cached::load($_template);
     }
     if ($_template->cached->handler->process($_template)) {
         ob_start();
         $_template->properties['unifunc']($_template);
         return ob_get_clean();
     }
     return null;
 }
Exemplo n.º 2
0
 /**
  * Load cached object
  *
  */
 public function loadCached()
 {
     if (!isset($this->cached)) {
         if (!class_exists('Smarty_Template_Cached', false)) {
             require SMARTY_SYSPLUGINS_DIR . 'smarty_template_cached.php';
         }
         $this->cached = Smarty_Template_Cached::load($this);
     }
 }
 /**
  * Load cached object
  *
  */
 public function loadCached()
 {
     if (!isset($this->cached)) {
         $this->cached = Smarty_Template_Cached::load($this);
     }
 }
 /**
  * get Smarty property in template context
  *
  * @param string $property_name property name
  *
  * @return mixed
  * @throws SmartyException
  */
 public function __get($property_name)
 {
     switch ($property_name) {
         case 'source':
             $this->loadSource();
             return $this->source;
         case 'compiled':
             $this->compiled = Smarty_Template_Compiled::load($this);
             return $this->compiled;
         case 'cached':
             $this->cached = Smarty_Template_Cached::load($this);
             return $this->cached;
         case 'compiler':
             $this->smarty->loadPlugin($this->source->compiler_class);
             $this->compiler = new $this->source->compiler_class($this->source->template_lexer_class, $this->source->template_parser_class, $this->smarty);
             return $this->compiler;
             // FIXME: routing of template -> smarty attributes
         // FIXME: routing of template -> smarty attributes
         default:
             if (property_exists($this->smarty, $property_name)) {
                 return $this->smarty->{$property_name};
             }
             throw new SmartyException("template property '{$property_name}' does not exist.");
     }
 }
Exemplo n.º 5
0
 /**
  * Load cached object
  *
  * @param bool $force force new cached object
  */
 public function loadCached($force = false)
 {
     if ($force || !isset($this->cached)) {
         $this->cached = Smarty_Template_Cached::load($this);
     }
 }