Zend\Mvc\Service\ViewHelperManagerFactory::createDoctypeHelperFactory PHP 메소드

createDoctypeHelperFactory() 개인적인 메소드

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