public function __construct()
 {
     //获取主题配置
     if ($theme = Config::get('site.theme', 'default')) {
         $path = App::make('path') . '/views/frontend/' . $theme;
         View::getFinder()->setDefaultNamespace($theme, $path);
     }
 }
 /**
  * @param \Smarty_Template_Source   $source
  * @param \Smarty_Internal_Template $_template
  *
  * @return string
  */
 protected function buildFilepath(\Smarty_Template_Source $source, \Smarty_Internal_Template $_template = null)
 {
     return \View::getFinder()->find($source->name);
 }
Example #3
0
 /**
  * @param $tpl
  *
  * @return string
  */
 protected function getTemplatePath($tpl)
 {
     $tpl = str_replace('#', '::', $tpl);
     return file_exists($tpl) ? $tpl : \View::getFinder()->find($tpl);
 }
 public function testRegisteredNamespaces()
 {
     $this->assertArrayHasKey('js-localization', Config::getNamespaces(), 'Configuration namespace not registered: js-localization');
     $this->assertArrayHasKey('js-localization', View::getFinder()->getHints(), 'View namespace not registered: js-localization');
 }