/**
  * Initialize Savant3 and set defaults
  */
 public function __construct()
 {
     parent::__construct();
     $this->template_extension = 'tpl.php';
     require_once 'lib/Savant3.php';
     $config = array('template_path' => $this->template_path);
     $this->engine = new Savant3($config);
     $this->ready();
 }
Ejemplo n.º 2
0
 /**
  * Initialize Smarty3 and set defaults
  */
 public function __construct()
 {
     parent::__construct();
     require_once 'lib/Smarty/Smarty.class.php';
     $this->engine = new Smarty();
     $this->engine->setCacheDir($this->cache_path);
     $this->engine->setCompileDir($this->compile_path);
     $this->engine->setTemplateDir($this->template_path);
     /**
      * For config see:
      * http://www.smarty.net/docs/en/config.files.tpl
      */
     /*
      * $this->engine->setConfigDir( $template_dir . 'configs/');
      */
     // Add custom plugins to smarty (per template).
     $plugin_dir = apply_filters('smarty3-template-plugin-dir', 'smarty-plugins');
     /**
      * Add theme plugins & child-theme plugins
      */
     if (!empty($plugin_dir)) {
         $template_root = get_template_directory();
         $plugin_bases = array($template_root);
         $child_root = get_stylesheet_directory();
         if ($child_root !== $template_root) {
             $plugin_bases[] = $child_root;
         }
         foreach ($plugin_bases as $plugin_base) {
             $plugin_dir = implode(DIRECTORY_SEPARATOR, array($plugin_base, $plugin_dir, ''));
             if (is_dir($plugin_dir)) {
                 $this->engine->addPluginsDir($plugin_dir);
             }
         }
     }
     /**
      * Caching - when and how?
      * http://www.smarty.net/docsv2/en/caching.tpl
      */
     $this->engine->caching = 0;
     $this->ready();
 }