Changement emplacmement templates
This commit is contained in:
@@ -5,10 +5,12 @@
|
||||
* @file
|
||||
* Functions needed for Thelia bootstrap
|
||||
*/
|
||||
define('THELIA_ROOT', realpath(__DIR__ .'/../') . "/");
|
||||
define('THELIA_CONF_DIR', THELIA_ROOT . '/local/config');
|
||||
define('THELIA_MODULE_DIR', THELIA_ROOT . '/local/modules');
|
||||
define('THELIA_TEMPLATE_DIR', THELIA_ROOT . 'templates/');
|
||||
define('THELIA_ROOT' , rtrim(realpath(__DIR__ .'/../'),'/') . "/");
|
||||
define('THELIA_LOCAL_DIR' , THELIA_ROOT . '/local/');
|
||||
define('THELIA_CONF_DIR' , THELIA_LOCAL_DIR . 'config/');
|
||||
define('THELIA_MODULE_DIR' , THELIA_LOCAL_DIR . 'modules/');
|
||||
define('THELIA_TEMPLATE_DIR' , THELIA_ROOT . '/web/templates/');
|
||||
|
||||
$loader = require __DIR__ . "/vendor/autoload.php";
|
||||
|
||||
|
||||
|
||||
@@ -56,10 +56,12 @@
|
||||
<call method="setContext">
|
||||
<argument type="service" id="request.context"/>
|
||||
</call>
|
||||
<!--
|
||||
<call method="add">
|
||||
<argument type="service" id="router.default_route"/>
|
||||
<argument>-255</argument>
|
||||
</call>
|
||||
-->
|
||||
<call method="add">
|
||||
<argument type="service" id="router.admin"/>
|
||||
<argument>0</argument>
|
||||
|
||||
@@ -79,19 +79,19 @@ class ViewListener implements EventSubscriberInterface
|
||||
} catch(ResourceNotFoundException $e) {
|
||||
$event->setResponse(new Response($e->getMessage(), 404));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function beforeKernelView(GetResponseForControllerResultEvent $event)
|
||||
{
|
||||
$request = $this->container->get('request');
|
||||
|
||||
|
||||
if (!$view = $request->attributes->get('_view')) {
|
||||
$request->attributes->set('_view', $this->findView($request));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function findView(Request $request)
|
||||
{
|
||||
if (! $view = $request->query->get('view')) {
|
||||
@@ -100,7 +100,7 @@ class ViewListener implements EventSubscriberInterface
|
||||
$view = $request->request->get('view');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ class ViewListener implements EventSubscriberInterface
|
||||
KernelEvents::VIEW =>array(
|
||||
array('onKernelView', 0),
|
||||
array('beforeKernelView', 5)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user