public function SearchExtraTypeSearch::buildResults in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php \Drupal\search_extra_type\Plugin\Search\SearchExtraTypeSearch::buildResults()
Executes the search and builds render arrays for the result items.
Return value
array An array of render arrays of search result items (generally each item has '#theme' set to 'search_result'), or an empty array if there are no results.
Overrides SearchPluginBase::buildResults
File
- core/
modules/ search/ tests/ modules/ search_extra_type/ src/ Plugin/ Search/ SearchExtraTypeSearch.php, line 75 - Contains \Drupal\search_extra_type\Plugin\Search\SearchExtraTypeSearch.
Class
- SearchExtraTypeSearch
- Executes a dummy keyword search.
Namespace
Drupal\search_extra_type\Plugin\SearchCode
public function buildResults() {
$results = $this
->execute();
$output['prefix']['#markup'] = '<h2>Test page text is here</h2> <ol class="search-results">';
foreach ($results as $entry) {
$output[] = array(
'#theme' => 'search_result',
'#result' => $entry,
'#plugin_id' => 'search_extra_type_search',
);
}
$pager = array(
'#type' => 'pager',
);
$output['suffix']['#markup'] = '</ol>' . drupal_render($pager);
return $output;
}