1. 程式人生 > >phalcon: 開啟模板緩存和緩存路徑

phalcon: 開啟模板緩存和緩存路徑

php onf config ledir edi clas cati function ()

 /**
         * 設置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; });

  

phalcon: 開啟模板緩存和緩存路徑