Пример #1
0
 public function __construct()
 {
     //smarty
     if (front::$smarty == '') {
         //smarty
         ini_set('include_path', ABS_PATH . 'library' . DIRECTORY_SEPARATOR . 'smarty' . PATH_SEPARATOR . ini_get('include_path'));
         require_once 'Smarty.class.php';
         //
         $smartyInstance = new smarty();
         if (!isset($_GET['preview']) || !intval($_GET['preview'])) {
             $smartyInstance->template_dir = ABS_PATH . 'smarty' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR;
         } else {
             $smartyInstance->template_dir = ABS_PATH . 'templates' . DIRECTORY_SEPARATOR;
         }
         $smartyInstance->compile_dir = ABS_PATH . 'smarty' . DIRECTORY_SEPARATOR . 'templates_c' . DIRECTORY_SEPARATOR;
         $smartyInstance->config_dir = ABS_PATH . 'smarty' . DIRECTORY_SEPARATOR . 'configs' . DIRECTORY_SEPARATOR;
         $smartyInstance->cache_dir = ABS_PATH . 'smarty' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
         $smartyInstance->use_sub_dirs = true;
         front::$smarty = $smartyInstance;
         front::assignConstant();
     }
 }