# Class SimpleLoopElement

  Thelia\Tpex\Element\BaseElement
  Thelia\Tpex\Element\SimpleLoopElement

Namespace: Thelia\Tpex\Element
Located at core/lib/Thelia/Tpex/Element/SimpleLoopElement.php

Methods summary
`public` | # `__construct( mixed $name, array $loop, Symfony\Component\HttpFoundation\Request $request, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher )`
`public` | # `setArgs( mixed $args )`
`public string` | # `exec( array $substitutions = array() )` main function. execute the loop, make substitution and return the result. Result can be an empty string #### Parameters $substitutions `array` $substitutions #### Returns `string`
`protected boolean|`Thelia\Tpex\Element\Loop\LoopIterationCollection`` | # `prepareLoop( mixed $args )` #### Parameters $args `mixed` $args #### Returns `boolean|`Thelia\Tpex\Element\Loop\LoopIterationCollection``
`protected string` | # `execLoop( string $text, string $args )` execute the loop and return the substitutions #### Parameters $text `string` $text all the variable $args `string` $args arguments loop #### Returns `string`
`protected `Thelia\Tpex\Element\Loop\BaseLoop`` | # `constructLoop( string $name )` find the loop class with his name and construct an instance of this class #### Parameters $name `string` $name #### Returns ``Thelia\Tpex\Element\Loop\BaseLoop`` #### Throws ``Thelia\Tpex\Exception\InvalidElementException`` ``Thelia\Tpex\Exception\ElementNotFoundException``
`public` | # `addVar( mixed $token )`
`public mixed` | # `addContent( mixed $content )` #### Parameters $content `mixed` $content #### Returns `mixed`
`public integer` | # `type( )` type must return the code of this element. ex : return Thelia\Tpex\TpexToken::TpexText #### Returns `integer`

Methods inherited from Thelia\Tpex\Element\BaseElement
`replace()`

Properties summary
`public mixed` | $name | `` | #
`public mixed` | $args | `` | #
`public array` | $variables | `array()` | #
`public mixed` | $type | `` | #
`public boolean` | $empty | `true` | #
`protected integer` | $count | `1` | #
`protected array` | $loop | `array()` | #
`protected array` | $loopInstance | `array()` | #
`protected mixed` | $request | `` | #
`protected mixed` | $dispatcher | `` | #

Properties inherited from Thelia\Tpex\Element\BaseElement
`$content`