Zend\Mvc\View\Http\ViewManager::registerViewStrategies PHP Method

registerViewStrategies() protected method

If there is a "strategies" key of the view manager configuration, loop through it. Pull each as a service from the service manager, and, if it is a ListenerAggregate, attach it to the view, at priority 100. This latter allows each to trigger before the default strategy, and for them to trigger in the order they are registered.
protected registerViewStrategies ( ) : void
return void
    protected function registerViewStrategies()
    {
        if (!isset($this->config['strategies'])) {
            return;
        }
        $strategies = $this->config['strategies'];
        if (is_string($strategies)) {
            $strategies = [$strategies];
        }
        if (!is_array($strategies) && !$strategies instanceof Traversable) {
            return;
        }
        $view = $this->getView();
        $events = $view->getEventManager();
        foreach ($strategies as $strategy) {
            if (!is_string($strategy)) {
                continue;
            }
            $listener = $this->services->get($strategy);
            if ($listener instanceof ListenerAggregateInterface) {
                $listener->attach($events, 100);
            }
        }
    }