Specifying custom paths for views, layouts, partials

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Specifying custom paths for views, layouts, partials

Andreas Möller
Hello,


what would be the best solution to ensure templates are resolved if I decide to use a directory structure different from that in the ZendSkeletonApplication?

Let's say that for better maintainability I want to have a directory layout similar to what we are used to from ZF1:

/application/modules/Application/views/
    layouts/
    partials/
    scripts/

What do I need to do?


Best regards,

Andreas
--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Specifying custom paths for views, layouts, partials

Andreas Möller
> what would be the best solution to ensure templates are resolved if I decide to use a directory structure different from that in the ZendSkeletonApplication?
>
> Let's say that for better maintainability I want to have a directory layout similar to what we are used to from ZF1:
>
> /application/modules/Application/views/
>    layouts/
>    partials/
>    scripts/
>
> What do I need to do?

The reason I am asking is: it feels weird to just add another directory

        'not_found_template' => 'error/404.phtml',
        'exception_template' => 'error/index.phtml',
        'layout' => 'layouts/layout.phtml',
        'template_path_stack' => array(
            __DIR__ . '/../views',
            __DIR__ . '/../views/scripts',
        ),

to the template stack while I don't want a view template resolver to look into two (!) directories if the directory in which view scripts for corresponding actions is known. I believe I should specify the directory somewhere for the resolver, but I don't get it - yet.


Best regards,

Andreas
--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]