{title}'; protected function _doList() { if (($html = $this->_renderPages(self::getPage('sub')))) { $this->_addItem([ 'text' => $html, 'tpl' => $this->getTemplate('text.tpl'), ]); } return $this; } protected function _renderPages($list) { $html = ''; if (empty($list)) { return $html; } foreach ($list as $page) { $html .= Qs_String::fill( $this->_pattern, [ 'title' => htmlspecialchars($page['menuTitle']), 'url' => htmlspecialchars($page['url']), ], '{}' ); if (!empty($page['sub'])) { $html .= $this->_renderPages($page['sub']); } } return $html ? '' : ''; } }