Zend\Mvc\Service\ViewTemplatePathStackFactory::__invoke PHP Method

__invoke() public method

Creates a Zend\View\Resolver\TemplatePathStack and populates it with the ['view_manager']['template_path_stack'] and sets the default suffix with the ['view_manager']['default_template_suffix']
public __invoke ( Interop\Container\ContainerInterface $container, string $name, array $options = null ) : Zend\View\Resolver\TemplatePathStack
$container Interop\Container\ContainerInterface
$name string
$options array
return Zend\View\Resolver\TemplatePathStack
    public function __invoke(ContainerInterface $container, $name, array $options = null)
    {
        $config = $container->get('config');
        $templatePathStack = new ViewResolver\TemplatePathStack();
        if (is_array($config) && isset($config['view_manager'])) {
            $config = $config['view_manager'];
            if (is_array($config)) {
                if (isset($config['template_path_stack'])) {
                    $templatePathStack->addPaths($config['template_path_stack']);
                }
                if (isset($config['default_template_suffix'])) {
                    $templatePathStack->setDefaultSuffix($config['default_template_suffix']);
                }
            }
        }
        return $templatePathStack;
    }
ViewTemplatePathStackFactory