Zend\Mvc\View\Http\ViewManager::registerViewStrategies PHP 메소드

registerViewStrategies() 보호된 메소드

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
리턴 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);
            }
        }
    }