- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.core.php
r1153 r706 39 39 public $rest; ///< <b>dcRestServer</b> dcRestServer object 40 40 public $log; ///< <b>dcLog</b> dcLog object 41 public $tpl; ///< <b>Twig_Environment</b> Twig_Environment object42 41 43 42 private $versions = null; … … 96 95 $this->addFormater('xhtml', create_function('$s','return $s;')); 97 96 $this->addFormater('wiki', array($this,'wikiTransform')); 98 $this->loadTemplateEnvironment();99 97 } 100 98 … … 120 118 } 121 119 122 /**123 Create template environment (Twig_Environment instance)124 125 default-templates path must be added from admin|public/prepend.php with:126 $core->tpl->getLoader()->addPath('PATH_TO/default-templates');127 Selected theme path must be added with:128 $core->tpl->getLoader()->prependPath('PATH_TO/MY_THEME');129 */130 public function loadTemplateEnvironment()131 {132 $cache_dir = path::real(DC_TPL_CACHE.'/twtpl',false);133 if (!is_dir($cache_dir)) {134 try {135 files::makeDir($cache_dir);136 } catch (Exception $e) {137 $cache_dir = false;138 }139 }140 141 $this->tpl = new Twig_Environment(142 new Twig_Loader_Filesystem(dirname(__FILE__).'/../swf'),143 array(144 'auto_reload' => true,145 'autoescape' => false,146 'base_template_class' => 'Twig_Template',147 'cache' => $cache_dir,148 'charset' => 'UTF-8',149 'debug' => DC_DEBUG,150 'optimizations' => -1,151 'strict_variables' => 0 //DC_DEBUG // Please fix undefined variables!152 )153 );154 $this->tpl->addExtension(new dcFormExtension($this));155 $this->tpl->addExtension(new dcTabExtension($this));156 }157 120 158 121 /// @name Blog init methods
Note: See TracChangeset
for help on using the changeset viewer.