/** * @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; }
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!'); }
/** * @param \Iterator $iterator */ public function add(\Iterator $iterator) { $this->iterators->append($iterator); }