/**
         * 设置view
         */
        $di->set('view', function () use ($config) {
            $view = new \Phalcon\Mvc\View();
            $view->setViewsDir(BASE_PATH . $config->home_application->viewsDir);
            $view->registerEngines(array(
                '.phtml' => function($view, $di) use ($config) {
                    $volt = new \Phalcon\Mvc\View\Engine\Volt($view, $di);
                    $volt -> setOptions(array(
                        'compileAlways' => true,
                        'compiledPath'  =>  BASE_PATH . $config->home_application->compileDir,
                    ));
                    return $volt;
                },
            ));
            return $view;
        });

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
  • 2021-09-21
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2021-06-12
  • 2021-11-16
  • 2021-06-15
相关资源
相似解决方案