public function renderContents($contents) { $html = ''; $contents = $this->filterContentsForAccess($contents); foreach ($contents as $content) { if (is_string($content)) { $html .= $content; continue; } if ('stopper' === $content->getType()) { if ($html) { break; } continue; } $html .= $this->renderContent($content); } return $html; }