public function __construct(Module $module, array $data = []) { $this->engine = new Engine(VIEWPATH, 'php'); foreach ($module->getList('module') as $mod) { if (is_dir($mod_view = $mod->path . 'mod/views/')) { $this->paths[$mod->name] = $mod_view; $this->engine->addFolder($mod->name, $mod_view); } } if ($currentModule = $module->getCurrent()) { $this->engine->setDirectory($this->paths[$currentModule]); } }
public function __construct(Module $modules, Module\Loader $load) { $configs = new AssetConfig($this->configs); if (!($cache_path = config_item('cache_path'))) { $cache_path = FCPATH . 'asset/cache/'; config_item('cache_path', $cache_path); } $configs->cachePath('js', $cache_path . 'js'); $configs->cachePath('css', $cache_path . 'css'); foreach ($modules->getList('module') as $module) { $configs->set('js.paths', $module->path . 'asset/scripts/**'); $configs->set('css.paths', $module->path . 'asset/styles/**'); } $this->factory = new Factory($configs); }