public function parse()
{
// more matches to be found than?
if ($this->pagination['num_items'] > count($this->items)) {
// remove last result (to add this reference)
array_pop($this->items);
// add reference to full search results page
$this->items[] = array('title' => FL::lbl('More'), 'text' => FL::msg('MoreResults'), 'full_url' => FrontendNavigation::getURLForBlock('Search') . '?form=search&q=' . $this->term);
}
$charset = $this->getContainer()->getParameter('kernel.charset');
// format data
foreach ($this->items as &$item) {
// format description
$item['text'] = !empty($item['text']) ? mb_strlen($item['text']) > $this->length ? mb_substr(strip_tags($item['text']), 0, $this->length, $charset) . '…' : $item['text'] : '';
}
// output
$this->output(self::OK, $this->items);
}