protected function injectComponents(
        array $pages,
        $routeMatch = null,
        $router = null,
        $request = null
    ) {
        if ($routeMatch) {
            /* @var RouteMatch|MvcRouter\RouteMatch $routeMatch */
            $routeName = $routeMatch->getMatchedRouteName();

            foreach ($pages as &$page) {
                if (isset($page['active_on']) && in_array($routeName, (array) $page['active_on'])) {
                    $page['active'] = true;
                }
            }
        }

        return parent::injectComponents($pages, $routeMatch, $router, $request);
    }
protected function injectComponents(
        array $pages,
        $routeMatch = null,
        $router = null,
        $request = null
    ) {
        if ($routeMatch) {
            /* @var RouteMatch|MvcRouter\RouteMatch $routeMatch */
            $routeName = $routeMatch->getMatchedRouteName();

            foreach ($pages as &$page) {
                if (isset($page['active_on']) && in_array($routeName, (array) $page['active_on'])) {
                    $page['active'] = true;
                }
            }
        }

        return parent::injectComponents($pages, $routeMatch, $router, $request);
    }
protected function injectComponents ( array $ pages , $ routeMatch = null , $ router = null , $ request = null ) { if ( $ routeMatch ) { /* @var RouteMatch|MvcRouter\RouteMatch $routeMatch */ $ routeName = $ routeMatch -> getMatchedRouteName ( ) ; foreach ( $ pages as & $ page ) { if ( isset ( $ page [ 'active_on' ] ) && in_array ( $ routeName , ( array ) $ page [ 'active_on' ] ) ) { $ page [ 'active' ] = true ; } } } return parent :: injectComponents ( $ pages , $ routeMatch , $ router , $ request ) ; }
Inject components into the pages.

@internal
Parses the pages options for the "active_on" property and
sets the active flag if one of the routes match.

{@inheritDoc}
@since 0.30 add check, if $routeMatch is null
Inject components into the pages .