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