Skip to content

Commit 668bc42

Browse files
committed
Add childAt() method
1 parent 30e4465 commit 668bc42

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/WebApp/Component/Container.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ public function __construct($parent, $content = NULL) {
1818
}
1919
}
2020

21+
public function childAt($index) {
22+
if (count($this->children) > $index) {
23+
return $this->children[$index];
24+
}
25+
return NULL;
26+
}
27+
2128
public function addChild($child) {
2229
$this->children[] = $child;
2330
}

0 commit comments

Comments
 (0)