save Tpex commit
This commit is contained in:
@@ -152,7 +152,7 @@ class Parser implements ParserInterface
|
|||||||
|
|
||||||
$tpex->init($this->container->get("request"), $this->container->get("dispatcher"), $content, THELIA_TEMPLATE_DIR . rtrim($this->template, "/") . "/");
|
$tpex->init($this->container->get("request"), $this->container->get("dispatcher"), $content, THELIA_TEMPLATE_DIR . rtrim($this->template, "/") . "/");
|
||||||
$tpex->configure(
|
$tpex->configure(
|
||||||
array(),
|
array("foo" => "Test\Loop\Foo"),
|
||||||
array(),
|
array(),
|
||||||
array(
|
array(
|
||||||
"secure" => "Thelia\Core\Template\BaseParam\Secure"
|
"secure" => "Thelia\Core\Template\BaseParam\Secure"
|
||||||
|
|||||||
Submodule core/lib/Thelia/Tpex updated: b591fc524d...35d0fa177d
28
local/plugins/Test/Loop/Foo.php
Normal file
28
local/plugins/Test/Loop/Foo.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Created by JetBrains PhpStorm.
|
||||||
|
* User: manu
|
||||||
|
* Date: 14/03/13
|
||||||
|
* Time: 15:16
|
||||||
|
* To change this template use File | Settings | File Templates.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Test\Loop;
|
||||||
|
|
||||||
|
use Thelia\Tpex\Element\Loop\BaseLoop;
|
||||||
|
|
||||||
|
class Foo extends BaseLoop {
|
||||||
|
|
||||||
|
public function exec($text, $args)
|
||||||
|
{
|
||||||
|
$res = "";
|
||||||
|
for($i = 0; $i < 4; $i++) {
|
||||||
|
$tmp = str_replace("#TOTO", "toto".$i, $text);
|
||||||
|
$tmp = str_replace("#TUTU", "tutu".$i, $tmp);
|
||||||
|
|
||||||
|
$res .= $tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user