children[] = $child; return $this; } final protected function renderChildren() { $out = array(); foreach ($this->children as $child) { $out[] = $this->renderChild($child); } return implode('', $out); } private function renderChild($child) { if ($child instanceof AphrontView) { return $child->render(); } else if (is_array($child)) { $out = array(); foreach ($child as $element) { $out[] = $this->renderChild($element); } return implode('', $out); } else { return $child; } } abstract public function render(); }