Exemple #1
0
 /**
  * @param null $name
  * @return Liste|Element[]
  */
 public function getChildElements($name = null)
 {
     $children = new Liste();
     foreach ($this->children as $child) {
         if ($child instanceof Element && ($name === null || $child->getName() == $name)) {
             $children->append($child);
         }
     }
     return $children;
 }
Exemple #2
0
 public function testArrayBlockWithListtAndMap()
 {
     $this->givenATemplate('Hello{{#myTag}} {{foo}}{{#isLast}}!{{/isLast}}{{/myTag}}');
     $this->givenAViewObject();
     $myTag = new Liste();
     $myTag->append(new Map(array('foo' => 'Hi')));
     $myTag->append(new Map(array('foo' => 'You', 'isLast' => true)));
     $this->givenTheViewObjectContainsTheProperty_WithValue('myTag', $myTag);
     $this->whenTheTemplateIsRenderedWithThisView();
     $this->thenTheOutputShouldBe('Hello Hi You!');
 }
Exemple #3
0
 /**
  * @param \Iterator $iterator
  */
 public function add(\Iterator $iterator)
 {
     $this->iterators->append($iterator);
 }