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

__invoke() public method

Retrieves the ViewJsonRenderer service from the service locator, and injects it into the constructor for the JSON strategy. It then attaches the strategy to the View service, at a priority of 100.
public __invoke ( Interop\Container\ContainerInterface $container, string $name, array $options = null ) : Zend\View\Strategy\JsonStrategy
$container Interop\Container\ContainerInterface
$name string
$options array
return Zend\View\Strategy\JsonStrategy
    public function __invoke(ContainerInterface $container, $name, array $options = null)
    {
        $jsonRenderer = $container->get('ViewJsonRenderer');
        $jsonStrategy = new JsonStrategy($jsonRenderer);
        return $jsonStrategy;
    }
ViewJsonStrategyFactory