Zend\Mvc\Service\ViewHelperManagerFactory::createDoctypeHelperFactory PHP Méthode

createDoctypeHelperFactory() private méthode

Other view helpers depend on this to decide which spec to generate their tags based on. This is why it must be set early instead of later in the layout phtml.
private createDoctypeHelperFactory ( Interop\Container\ContainerInterface $services ) : callable
$services Interop\Container\ContainerInterface
Résultat callable
    private function createDoctypeHelperFactory(ContainerInterface $services)
    {
        return function () use($services) {
            $config = $services->has('config') ? $services->get('config') : [];
            $config = isset($config['view_manager']) ? $config['view_manager'] : [];
            $helper = new ViewHelper\Doctype();
            if (isset($config['doctype']) && $config['doctype']) {
                $helper->setDoctype($config['doctype']);
            }
            return $helper;
        };
    }