protected function FacetapiWidgetLinks::setThemeHooks in Facet API 6.3
Same name and namespace in other branches
- 7.2 plugins/facetapi/widget_links.inc \FacetapiWidgetLinks::setThemeHooks()
- 7 plugins/facetapi/widget_links.inc \FacetapiWidgetLinks::setThemeHooks()
Recursive function that sets each item's theme hook.
Parameters
array &$build: A render array containing the facet items.
1 call to FacetapiWidgetLinks::setThemeHooks()
- FacetapiWidgetLinks::execute in plugins/
facetapi/ widget_links.inc - Renders the links.
File
- plugins/
facetapi/ widget_links.inc, line 39 - Widgets for facets rendered as links.
Class
- FacetapiWidgetLinks
- Widget that renders facets as a list of clickable links.
Code
protected function setThemeHooks(array &$build) {
foreach ($build as $value => &$item) {
$item['#theme'] = $item['#active'] ? 'facetapi_link_active' : 'facetapi_link_inactive';
if (!empty($item['#item_children'])) {
$this
->setThemeHooks($item['#item_children']);
}
}
return $this;
}