This commit is contained in:
Manuel Raynaud
2013-03-13 19:51:07 +01:00
parent 27900374bf
commit 3a415d1123
5 changed files with 84 additions and 59 deletions

96
composer.lock generated
View File

@@ -192,17 +192,17 @@
},
{
"name": "symfony/class-loader",
"version": "v2.1.7",
"version": "v2.1.8",
"target-dir": "Symfony/Component/ClassLoader",
"source": {
"type": "git",
"url": "https://github.com/symfony/ClassLoader",
"reference": "v2.1.7"
"url": "https://github.com/symfony/ClassLoader.git",
"reference": "v2.1.8"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/ClassLoader/archive/v2.1.7.zip",
"reference": "v2.1.7",
"url": "https://api.github.com/repos/symfony/ClassLoader/zipball/v2.1.8",
"reference": "v2.1.8",
"shasum": ""
},
"require": {
@@ -211,7 +211,7 @@
"require-dev": {
"symfony/finder": "2.1.*"
},
"time": "2013-01-09 08:51:07",
"time": "2013-01-26 07:21:53",
"type": "library",
"autoload": {
"psr-0": {
@@ -237,17 +237,17 @@
},
{
"name": "symfony/config",
"version": "v2.1.7",
"version": "v2.1.8",
"target-dir": "Symfony/Component/Config",
"source": {
"type": "git",
"url": "https://github.com/symfony/Config",
"reference": "v2.1.7"
"url": "https://github.com/symfony/Config.git",
"reference": "v2.1.8"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Config/archive/v2.1.7.zip",
"reference": "v2.1.7",
"url": "https://api.github.com/repos/symfony/Config/zipball/v2.1.8",
"reference": "v2.1.8",
"shasum": ""
},
"require": {
@@ -279,17 +279,17 @@
},
{
"name": "symfony/console",
"version": "v2.1.7",
"version": "v2.1.8",
"target-dir": "Symfony/Component/Console",
"source": {
"type": "git",
"url": "https://github.com/symfony/Console",
"reference": "v2.1.7"
"url": "https://github.com/symfony/Console.git",
"reference": "v2.1.8"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Console/archive/v2.1.7.zip",
"reference": "v2.1.7",
"url": "https://api.github.com/repos/symfony/Console/zipball/v2.1.8",
"reference": "v2.1.8",
"shasum": ""
},
"require": {
@@ -321,17 +321,17 @@
},
{
"name": "symfony/dependency-injection",
"version": "v2.1.7",
"version": "v2.1.8",
"target-dir": "Symfony/Component/DependencyInjection",
"source": {
"type": "git",
"url": "https://github.com/symfony/DependencyInjection",
"reference": "v2.1.7"
"url": "https://github.com/symfony/DependencyInjection.git",
"reference": "v2.1.8"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/DependencyInjection/archive/v2.1.7.zip",
"reference": "v2.1.7",
"url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/v2.1.8",
"reference": "v2.1.8",
"shasum": ""
},
"require": {
@@ -345,7 +345,7 @@
"symfony/config": "2.1.*",
"symfony/yaml": "2.1.*"
},
"time": "2013-01-17 21:21:51",
"time": "2013-02-11 11:42:49",
"type": "library",
"autoload": {
"psr-0": {
@@ -371,17 +371,17 @@
},
{
"name": "symfony/event-dispatcher",
"version": "v2.1.7",
"version": "v2.1.8",
"target-dir": "Symfony/Component/EventDispatcher",
"source": {
"type": "git",
"url": "https://github.com/symfony/EventDispatcher",
"reference": "v2.1.7"
"url": "https://github.com/symfony/EventDispatcher.git",
"reference": "v2.1.8"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/EventDispatcher/archive/v2.1.7.zip",
"reference": "v2.1.7",
"url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/v2.1.8",
"reference": "v2.1.8",
"shasum": ""
},
"require": {
@@ -394,7 +394,7 @@
"symfony/dependency-injection": "2.1.*",
"symfony/http-kernel": "2.1.*"
},
"time": "2013-01-11 00:31:43",
"time": "2013-02-11 11:26:14",
"type": "library",
"autoload": {
"psr-0": {
@@ -420,23 +420,23 @@
},
{
"name": "symfony/http-foundation",
"version": "v2.1.7",
"version": "v2.1.8",
"target-dir": "Symfony/Component/HttpFoundation",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpFoundation",
"reference": "v2.1.7"
"url": "https://github.com/symfony/HttpFoundation.git",
"reference": "v2.1.8"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/HttpFoundation/archive/v2.1.7.zip",
"reference": "v2.1.7",
"url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/v2.1.8",
"reference": "v2.1.8",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"time": "2013-01-11 00:31:43",
"time": "2013-02-22 18:02:22",
"type": "library",
"autoload": {
"psr-0": {
@@ -463,17 +463,17 @@
},
{
"name": "symfony/http-kernel",
"version": "v2.1.7",
"version": "v2.1.8",
"target-dir": "Symfony/Component/HttpKernel",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpKernel",
"reference": "v2.1.7"
"url": "https://github.com/symfony/HttpKernel.git",
"reference": "v2.1.8"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/HttpKernel/archive/v2.1.7.zip",
"reference": "v2.1.7",
"url": "https://api.github.com/repos/symfony/HttpKernel/zipball/v2.1.8",
"reference": "v2.1.8",
"shasum": ""
},
"require": {
@@ -499,7 +499,7 @@
"symfony/dependency-injection": "2.1.*",
"symfony/finder": "2.1.*"
},
"time": "2013-01-17 16:21:47",
"time": "2013-02-23 21:28:36",
"type": "library",
"autoload": {
"psr-0": {
@@ -525,34 +525,34 @@
},
{
"name": "symfony/routing",
"version": "v2.1.7",
"version": "v2.1.8",
"target-dir": "Symfony/Component/Routing",
"source": {
"type": "git",
"url": "https://github.com/symfony/Routing",
"reference": "v2.1.7"
"url": "https://github.com/symfony/Routing.git",
"reference": "v2.1.8"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Routing/archive/v2.1.7.zip",
"reference": "v2.1.7",
"url": "https://api.github.com/repos/symfony/Routing/zipball/v2.1.8",
"reference": "v2.1.8",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"doctrine/common": ">=2.2,<2.4-dev",
"doctrine/common": ">=2.2,<3.0",
"symfony/config": "2.1.*",
"symfony/http-kernel": "2.1.*",
"symfony/yaml": "2.1.*"
},
"suggest": {
"doctrine/common": ">=2.2,<2.4-dev",
"doctrine/common": "~2.2",
"symfony/config": "2.1.*",
"symfony/yaml": "2.1.*"
},
"time": "2013-01-09 08:51:07",
"time": "2013-02-22 18:53:49",
"type": "library",
"autoload": {
"psr-0": {

View File

@@ -69,11 +69,9 @@ class TheliaBundle extends Bundle
$container->register('resolver', 'Symfony\Component\HttpKernel\Controller\ControllerResolver');
$container->register('tpex', 'Thelia\Tpex\Tpex');
$container->register('parser','Thelia\Core\Template\Parser')
->addArgument(new Reference('service_container'))
->addArgument(new Reference('tpex'))
;
/**
* RouterListener implements EventSubscriberInterface and listen for kernel.request event

View File

@@ -75,10 +75,9 @@ class Parser implements ParserInterface
*
* public function __construct(ContainerBuilder $container)
*/
public function __construct(ContainerInterface $container, Tpex $tpex)
public function __construct(ContainerInterface $container)
{
$this->container = $container;
$this->tpex = $tpex;
}
/**
@@ -148,16 +147,18 @@ class Parser implements ParserInterface
public function loadParser()
{
$content = $this->openFile($this->getRequest());
$this->tpex->init($this->container->get("request"), $this->container->get("dispatcher"), $content, THELIA_TEMPLATE_DIR . rtrim($this->template, "/") . "/");
$this->tpex->configure(
$tpex = new Tpex();
$tpex->init($this->container->get("request"), $this->container->get("dispatcher"), $content, THELIA_TEMPLATE_DIR . rtrim($this->template, "/") . "/");
$tpex->configure(
array(),
array(),
array(
"secure" => "Thelia\Core\Template\BaseParam\Secure"
)
);
$this->setContent($this->tpex->execute());
$this->setContent($tpex->execute());
}
protected function openFile(Request $request)

View File

@@ -5,8 +5,34 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div>TODO write content
#INCLUDE "include1.html"
<div>TODO write content #SET{toto, 4} toto vaut #GET{toto} zeafazefaze azef azef azef azef
<THELIA_FOO type="foo" id="loop1" param1="#GET{toto}">
#TOTO
<THELIA_FU type="doobitch" param1="value1" param2="#TUTU">
#ALFRED azd azd azed azd
<T:CHAPO>#CHAPO</T:CHAPO>le chapo est vide<//T:CHAPO>
</THELIA_FU>
</THELIA_FOO>
<T_BAR>
avant boucle
<THELIA_BAR type="bar" id="loop2" param1="value1">
#FU
<TEST_ex3 variable="#UNEVARIABLE" test="egal" valeur="0">
UNEVARIABLE vaut zéro
</TEST_ex3>
UNEVARIABLE ne vaut pas zéro
<//TEST_ex3>
</THELIA_BAR>
après boucle
</T_BAR>
après boucle vide
<//T_BAR>
<REPEAT_loopy start="1" end="5" increment="2">
Compteur = #INDEX<br />
</REPEAT_loopy>
</div>
</body>
</html>