Esempio n. 1
0
/**
 * The URL component is used to generate all kind of urls in the application
 */
$di->set('url', function () use($config) {
    $url = new UrlResolver();
    $url->setBaseUri($config->uri->navigateur);
    return $url;
}, true);
$di->set('config', function () use($config) {
    return $config;
});
/**
 * Setting up the view component
 */
$di->set('view', function () use($config) {
    $view = new igoView();
    $view->config = $config;
    //$view->host=$config->igo->host;
    if (isset($config->application->pilotage)) {
        //vraiment utile?
        $view->metadonneesViewsDir = $config->application->pilotage->viewsDir;
    }
    $view->viewsDir = $config->application->navigateur->viewsDir;
    // $view->mapserver_path=$config->mapserver->url;
    $view->setViewsDir($config->application->navigateur->viewsDir);
    $view->registerEngines(array('.volt' => function ($view, $di) use($config) {
        $volt = new VoltEngine($view, $di);
        $volt->setOptions(array('compiledPath' => $config->application->navigateur->cacheDir, 'compiledSeparator' => '_', 'compileAlways' => isset($config->application->debug) && $config->application->debug ? true : false));
        return $volt;
    }, '.phtml' => 'Phalcon\\Mvc\\View\\Engine\\Php'));
    return $view;