rename plugins to modules

This commit is contained in:
Manuel Raynaud
2013-05-16 11:13:09 +02:00
parent 664a28f042
commit 20d1655c9d
10 changed files with 15 additions and 15 deletions

View File

@@ -0,0 +1,48 @@
<?php
/**
* Created by JetBrains PhpStorm.
* User: manu
* Date: 15/03/13
* Time: 09:23
* To change this template use File | Settings | File Templates.
*/
namespace Test\Loop;
use Thelia\Tpex\Element\Loop\BaseLoop;
use Thelia\Tpex\Tools;
use Thelia\Model\ProductQuery;
class Doobitch extends BaseLoop {
public function defineArgs()
{
return array(
"param1",
"param2" => array("default" => "foo")
);
}
public function exec($text)
{
$res = "";
if($this->param1 == 2 || $this->param1 == 3) {
for($i = 0; $i < 4; $i++) {
$tmp = str_replace("#ALFRED", "foo".$i, $text);
if($i%2){
$tmp = str_replace("#CHAPO", "bar".$i, $tmp);
} else {
$tmp = str_replace("#CHAPO", "", $tmp);
}
$res .= $tmp;
}
}
echo $this->param2;
return $res;
}
}

View File

@@ -0,0 +1,33 @@
<?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 defineArgs()
{
return array();
}
public function exec($text)
{
$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;
}
}