Search view scripts in 2 folders

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

Search view scripts in 2 folders

Cristian Bichis-4
Hi,

I would like to have this behaviour for the scripts rendered for one
controller

1. If the view script is found on current mymodule/mycontroller/myaction
path (modules/mymodule/mycontroller/views/scripts/myaction.phtml) is
rendered this

2. If is not found is rendered the one in:

modules/othermodule/othercontroller/views/scripts/myaction.phtml

Basically if the script is not found in normal path is searched into a
"backend" location.

Thank you,
Cristian
Reply | Threaded
Open this post in threaded view
|

Re: Search view scripts in 2 folders

Marco Pivetta
Just add multiple paths to your path stack resolver:
https://github.com/zendframework/ZendSkeletonApplication/blob/master/module/Application/config/module.config.php#L88

Marco Pivetta

http://twitter.com/Ocramius

http://marco-pivetta.com



On 4 September 2012 09:16, Cristian Bichis <[hidden email]> wrote:

> Hi,
>
> I would like to have this behaviour for the scripts rendered for one
> controller
>
> 1. If the view script is found on current mymodule/mycontroller/myaction
> path (modules/mymodule/**mycontroller/views/scripts/**myaction.phtml) is
> rendered this
>
> 2. If is not found is rendered the one in:
>
> modules/othermodule/**othercontroller/views/scripts/**myaction.phtml
>
> Basically if the script is not found in normal path is searched into a
> "backend" location.
>
> Thank you,
> Cristian
>
Reply | Threaded
Open this post in threaded view
|

Re: Search view scripts in 2 folders

Cristian Bichis-4
Hi Marco.

I mean for ZF1.

Btw, "mycontroller" will be different by "othercontroller".

Cristian

> Just add multiple paths to your path stack resolver:
> https://github.com/zendframework/ZendSkeletonApplication/blob/master/module/Application/config/module.config.php#L88
>
> Marco Pivetta
>
> http://twitter.com/Ocramius
>
> http://marco-pivetta.com
>
>
>
> On 4 September 2012 09:16, Cristian Bichis <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi,
>
>     I would like to have this behaviour for the scripts rendered for
>     one controller
>
>     1. If the view script is found on current
>     mymodule/mycontroller/myaction path
>     (modules/mymodule/mycontroller/views/scripts/myaction.phtml) is
>     rendered this
>
>     2. If is not found is rendered the one in:
>
>     modules/othermodule/othercontroller/views/scripts/myaction.phtml
>
>     Basically if the script is not found in normal path is searched
>     into a "backend" location.
>
>     Thank you,
>     Cristian
>
>