Example #1
0
 /**
  * Create template data object
  *
  * Some of the global Smarty settings copied to template scope
  * It load the required template resources and cacher plugins
  *
  * @param string                   $template_resource template resource string
  * @param Smarty                   $smarty            Smarty instance
  * @param Template $_parent           back pointer to parent object with variables or null
  * @param mixed                    $_compile_id       compile id or null
  */
 public function __construct($template_resource, $smarty, $_parent = null, $_compile_id = null)
 {
     $this->smarty =& $smarty;
     // Smarty parameter
     $this->compile_id = $_compile_id === null ? $this->smarty->compile_id : $_compile_id;
     $this->parent = $_parent;
     // Template resource
     $this->template_resource = $template_resource;
     // copy block data of template inheritance
     if ($this->parent instanceof Template) {
         $this->block_data = $this->parent->block_data;
     }
     $this->smarty->fetchedTemplate($template_resource);
 }