Une première version d'une version permettant d'avoir des templates différents suivant la langue.
A creuser mais peut-être pas besoin de TemplateSwitcher et de CustomSwitchTemplate, et qu'il suffirait de rajouter juste du Smarty dans layout.tpl et index.html
This commit is contained in:
18
local/modules/TemplateSwitcher/Config/config.xml
Normal file
18
local/modules/TemplateSwitcher/Config/config.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<config xmlns="http://thelia.net/schema/dic/config"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://thelia.net/schema/dic/config http://thelia.net/schema/dic/config/thelia-1.0.xsd">
|
||||
|
||||
<services>
|
||||
<service id="thelia.template_helper" class="TemplateSwitcher\Template\SessionTemplateHelper">
|
||||
<argument type="service" id="request_stack"/>
|
||||
</service>
|
||||
|
||||
<service id="templateswitcher.listener" class="TemplateSwitcher\EventListener\TemplateSwitcherListener">
|
||||
<argument type="service" id="request_stack"/>
|
||||
<argument type="service" id="thelia.template_helper"/>
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
</services>
|
||||
</config>
|
||||
28
local/modules/TemplateSwitcher/Config/module.xml
Normal file
28
local/modules/TemplateSwitcher/Config/module.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module xmlns="http://thelia.net/schema/dic/module"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://thelia.net/schema/dic/module http://thelia.net/schema/dic/module/module-2_2.xsd">
|
||||
<fullnamespace>TemplateSwitcher\TemplateSwitcher</fullnamespace>
|
||||
<descriptive locale="en_US">
|
||||
<title>Change current active template in real time</title>
|
||||
</descriptive>
|
||||
<descriptive locale="fr_FR">
|
||||
<title>Choisissez le template actif en temps réel</title>
|
||||
</descriptive>
|
||||
<languages>
|
||||
<language>en_US</language>
|
||||
<language>fr_FR</language>
|
||||
</languages>
|
||||
<version>0.5.0</version>
|
||||
<authors>
|
||||
<author>
|
||||
<name>Franck Allimant</name>
|
||||
<company>CQFDev</company>
|
||||
<email>thelia@cqfdev.fr</email>
|
||||
<website>www.cqfdev.fr</website>
|
||||
</author>
|
||||
</authors>
|
||||
<type>classic</type>
|
||||
<thelia>2.2.0</thelia>
|
||||
<stability>prod</stability>
|
||||
</module>
|
||||
11
local/modules/TemplateSwitcher/Config/routing.xml
Normal file
11
local/modules/TemplateSwitcher/Config/routing.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<route id="templateswitcher.set" path="/ts/{templateName}">
|
||||
<default key="_controller">TemplateSwitcher\Controller\SwitcherController::set</default>
|
||||
<requirement key="templateName">.*</requirement>
|
||||
</route>
|
||||
</routes>
|
||||
Reference in New Issue
Block a user