benjamindulau / Ano_ZFTwig

BSD 3-Clause "New" or "Revised" License
39 stars 8 forks source link

Application Resources not being called in ZF 1.11.9 #4

Open HelloGrayson opened 13 years ago

HelloGrayson commented 13 years ago

With Ano in library and the following configuration no application resources are firing. The init methods on Ano_Application_Resource_Twig and Ano_Application_Resource_View are not being called.

    autoloaderNamespaces[] = "Ano_"
    pluginPaths.Ano_Application_Resource = APPLICATION_PATH "/../library/Ano/Application/Resource"
    resources.view.engines.php.class = "Ano_View_Engine_PhpEngine"
    resources.view.engines.php.viewSuffix = "phtml"
    resources.view.engines.twig.class = "Ano_ZFTwig_View_Engine_TwigEngine"
    resources.view.engines.twig.isDefault = 1
    resources.view.engines.twig.viewSuffix = "twig"
    resources.view.engines.twig.options.charset = "utf-8"
    resources.view.engines.twig.options.strict_variables = 0
    resources.view.engines.twig.options.cache = APPLICATION_PATH "/../../data/cache/twig"
    resources.view.engines.twig.options.auto_escape = 1
    resources.view.engines.twig.options.auto_reload = 1
    resources.view.engines.twig.options.debug = 0
    resources.view.engines.twig.options.trim_blocks = 1
    resources.view.engines.twig.extensions.helper.class = "Ano_ZFTwig_Extension_HelperExtension"
    resources.view.engines.twig.extensions.trans.class = "Ano_ZFTwig_Extension_TransExtension"

Is it possible that resources.view[] = needs to be called afterwards? It seems like the ordering of application.ini is important, when should this config appear relatively in the broader scope ofc application.ini.

benjamindulau commented 13 years ago

It should work without the need of "resources.view[] = ", this is useful to force the view resource to be loaded even if no config is needed.

Have you added the "Ano_ZFTwig/library" path to your include_path directive in index.php ?

set_include_path(implode(PATH_SEPARATOR, array(
    get_include_path(),
    realpath(APPLICATION_PATH . '/../library'),
    realpath(APPLICATION_PATH . '/../library/Twig/lib'),
    realpath(APPLICATION_PATH . '/../library/Ano_ZFTwig/library'),
)));