Changement emplacmement templates

This commit is contained in:
franck
2013-06-10 15:36:02 +02:00
parent f9068878c7
commit 0b40f1a525
6 changed files with 256 additions and 432 deletions

View File

@@ -26,7 +26,8 @@
"symfony/validator": "2.2.*", "symfony/validator": "2.2.*",
"symfony/security": "2.2.*", "symfony/security": "2.2.*",
"symfony/templating": "2.2.*", "symfony/templating": "2.2.*",
"noiselabs/smarty-bundle": "dev-master"
"smarty/smarty": "v3.1.13"
}, },
"require-dev" : { "require-dev" : {
"fzaninotto/faker": "dev-master" "fzaninotto/faker": "dev-master"

658
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -5,10 +5,12 @@
* @file * @file
* Functions needed for Thelia bootstrap * Functions needed for Thelia bootstrap
*/ */
define('THELIA_ROOT', realpath(__DIR__ .'/../') . "/"); define('THELIA_ROOT' , rtrim(realpath(__DIR__ .'/../'),'/') . "/");
define('THELIA_CONF_DIR', THELIA_ROOT . '/local/config'); define('THELIA_LOCAL_DIR' , THELIA_ROOT . '/local/');
define('THELIA_MODULE_DIR', THELIA_ROOT . '/local/modules'); define('THELIA_CONF_DIR' , THELIA_LOCAL_DIR . 'config/');
define('THELIA_TEMPLATE_DIR', THELIA_ROOT . 'templates/'); define('THELIA_MODULE_DIR' , THELIA_LOCAL_DIR . 'modules/');
define('THELIA_TEMPLATE_DIR' , THELIA_ROOT . '/web/templates/');
$loader = require __DIR__ . "/vendor/autoload.php"; $loader = require __DIR__ . "/vendor/autoload.php";

View File

@@ -56,10 +56,12 @@
<call method="setContext"> <call method="setContext">
<argument type="service" id="request.context"/> <argument type="service" id="request.context"/>
</call> </call>
<!--
<call method="add"> <call method="add">
<argument type="service" id="router.default_route"/> <argument type="service" id="router.default_route"/>
<argument>-255</argument> <argument>-255</argument>
</call> </call>
-->
<call method="add"> <call method="add">
<argument type="service" id="router.admin"/> <argument type="service" id="router.admin"/>
<argument>0</argument> <argument>0</argument>

View File

@@ -79,19 +79,19 @@ class ViewListener implements EventSubscriberInterface
} catch(ResourceNotFoundException $e) { } catch(ResourceNotFoundException $e) {
$event->setResponse(new Response($e->getMessage(), 404)); $event->setResponse(new Response($e->getMessage(), 404));
} }
} }
public function beforeKernelView(GetResponseForControllerResultEvent $event) public function beforeKernelView(GetResponseForControllerResultEvent $event)
{ {
$request = $this->container->get('request'); $request = $this->container->get('request');
if (!$view = $request->attributes->get('_view')) { if (!$view = $request->attributes->get('_view')) {
$request->attributes->set('_view', $this->findView($request)); $request->attributes->set('_view', $this->findView($request));
} }
} }
public function findView(Request $request) public function findView(Request $request)
{ {
if (! $view = $request->query->get('view')) { if (! $view = $request->query->get('view')) {
@@ -100,7 +100,7 @@ class ViewListener implements EventSubscriberInterface
$view = $request->request->get('view'); $view = $request->request->get('view');
} }
} }
return $view; return $view;
} }
@@ -117,7 +117,7 @@ class ViewListener implements EventSubscriberInterface
KernelEvents::VIEW =>array( KernelEvents::VIEW =>array(
array('onKernelView', 0), array('onKernelView', 0),
array('beforeKernelView', 5) array('beforeKernelView', 5)
) )
); );
} }
} }

View File

@@ -1,5 +1,4 @@
<?php <?php
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Thelia\Core\Thelia; use Thelia\Core\Thelia;