ZF-Commons / ZfcTwig

Zend Framework 2 Module that provides a Twig rendering strategy
BSD 3-Clause "New" or "Revised" License
96 stars 55 forks source link

module throw exception if some module hasn't view folder. #70

Closed vnagara closed 11 years ago

vnagara commented 11 years ago

If some module hasn't view folder. then:

Fatal error: Uncaught exception 'Twig_Error_Loader' with message 'The "/www/libra-cms/vendor/libra/libra-locale/config/../view/" directory does not exist.' in /www/libra-cms/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 860

vnagara commented 11 years ago

module has those piece of config:

    'view_manager' => array(
        'template_path_stack' => array(
            __DIR__ . '/../view',
        ),
    ),
spiffyjr commented 11 years ago

The view folder must exist if it's in the template path stack.

vnagara commented 11 years ago

maybe, but with current ZF2 view strategy for .phtml it has no exceptions.

spiffyjr commented 11 years ago

The twig error loader is the extension. All path loading is done via Twig to keep the bridge between zf2 and twig as slim as possible.

vnagara commented 11 years ago

@spiffyjr Ok, I get it. Thanks.