start to create first loop

This commit is contained in:
Manuel Raynaud
2013-05-03 17:06:43 +02:00
parent 7d766c68ff
commit 046f0e0f94
10 changed files with 176 additions and 24 deletions

View File

@@ -15,13 +15,19 @@ use Thelia\Model\ProductQuery;
class Doobitch extends BaseLoop {
public function exec($text, $args)
public function defineArgs()
{
return array(
"param1",
"param2" => array("default" => "foo")
);
}
public function exec($text)
{
$param1 = Tools::extractValueParam("param1", $args);
$res = "";
if($param1 == 2 || $param1 == 3) {
if($this->param1 == 2 || $this->param1 == 3) {
for($i = 0; $i < 4; $i++) {
$tmp = str_replace("#ALFRED", "foo".$i, $text);
if($i%2){
@@ -35,6 +41,8 @@ class Doobitch extends BaseLoop {
}
}
echo $this->param2;
return $res;
}
}