Re: [Catalyst] Loading template according to request path

2009-08-14 Thread Richard Thomas
On 13/08/2009, at 7:56 PM, Eden Cardim wrote: The problem with that approach is that your view is now heavily coupled to your controller semantics. Whenever the semantics change, you'll run into refactor hell making the template paths match. In theory? Yes. In practice? Mmmm. The original

Re: [Catalyst] Loading template according to request path

2009-08-13 Thread Eden Cardim
On Tue, Aug 11, 2009 at 8:11 PM, J. Shirleyjshir...@gmail.com wrote: The fact that Chained doesn't render template from PathPart, but from the action name? :) It would be content/html.tt -- not content/as/html.tt not really: # insert jshirley's end action here -- Eden Cardim Need

Re: [Catalyst] Loading template according to request path

2009-08-13 Thread Eden Cardim
On Wed, Aug 12, 2009 at 9:58 PM, Richard Thomasr...@mac.com wrote: Matt, I don't know if any of this is useful to you. We do something that sounds a bit like what you're after, by tweaking the template include_path with each request. It's a classic path setting algorithm, working back from

Re: [Catalyst] Loading template according to request path

2009-08-12 Thread Richard Thomas
Matt, I don't know if any of this is useful to you. We do something that sounds a bit like what you're after, by tweaking the template include_path with each request. It's a classic path setting algorithm, working back from most specific to least specific location. ie, a template that

[Catalyst] Loading template according to request path

2009-08-11 Thread Matt Whipple
Is there a presently existing mechanism which flexibly allows for template selection according to the request URI? For instance a request to www.myapp.com/somepage would set something like stash(template = 'somepage.tt') if the file exists and continue to be processed by the appropriate or

Re: [Catalyst] Loading template according to request path

2009-08-11 Thread J. Shirley
On Tue, Aug 11, 2009 at 12:09 PM, Matt Whipple m...@mattwhipple.com wrote: Is there a presently existing mechanism which flexibly allows for template selection according to the request URI? For instance a request to www.myapp.com/somepage would set something like stash(template = '

Re: [Catalyst] Loading template according to request path

2009-08-11 Thread Matt Whipple
J. Shirley wrote: On Tue, Aug 11, 2009 at 12:09 PM, Matt Whipple m...@mattwhipple.com mailto:m...@mattwhipple.com wrote: Is there a presently existing mechanism which flexibly allows for template selection according to the request URI? For instance a request to

Re: [Catalyst] Loading template according to request path

2009-08-11 Thread fREW Schmidt
On Tue, Aug 11, 2009 at 3:01 PM, Matt Whipple m...@mattwhipple.com wrote: J. Shirley wrote: On Tue, Aug 11, 2009 at 12:09 PM, Matt Whipple m...@mattwhipple.commailto: m...@mattwhipple.com wrote: Is there a presently existing mechanism which flexibly allows for template selection

Re: [Catalyst] Loading template according to request path

2009-08-11 Thread Alejandro Imass
Well in Catalyst an action is usually mapped to a controller method, so I really don't understand your request. Maybe this example will help: sub edit : Local { my ( $self, $c ) = @_; my $uri = URI-new($c-req-base); # get whatever you want from the URI my $auth = $uri-authority; #do

Re: [Catalyst] Loading template according to request path

2009-08-11 Thread J. Shirley
On Tue, Aug 11, 2009 at 1:01 PM, Matt Whipple m...@mattwhipple.com wrote: This is the default behavior for View::TT, as it says in the POD: If a stash item isn't defined, then it instead uses the stringification of the action dispatched to (as defined by $c-action) in the above example,

Re: [Catalyst] Loading template according to request path

2009-08-11 Thread J. Shirley
On Tue, Aug 11, 2009 at 1:34 PM, Alejandro Imass alejandro.im...@gmail.comwrote: Well in Catalyst an action is usually mapped to a controller method, so I really don't understand your request. Maybe this example will help: sub edit : Local { my ( $self, $c ) = @_; my $uri =

Re: [Catalyst] Loading template according to request path

2009-08-11 Thread Matt Whipple
On Tue, Aug 11, 2009 at 3:01 PM, Matt Whipple m...@mattwhipple.com mailto:m...@mattwhipple.com wrote: J. Shirley wrote: On Tue, Aug 11, 2009 at 12:09 PM, Matt Whipple m...@mattwhipple.com mailto:m...@mattwhipple.com mailto:m...@mattwhipple.com

Re: [Catalyst] Loading template according to request path

2009-08-11 Thread Eden Cardim
On Tue, Aug 11, 2009 at 2:15 PM, Matt Whipplem...@mattwhipple.com wrote: Thanks everyone for your input, I'm certainly gathering that there is nothing preexisting that does what I'm looking to do.  I'll continue to clean up my version and throw it on CPAN if it seems appealing enough.  As a

Re: [Catalyst] Loading template according to request path

2009-08-11 Thread Alejandro Imass
very cool!, live and learn, thanks!! On Tue, Aug 11, 2009 at 4:59 PM, J. Shirleyjshir...@gmail.com wrote: On Tue, Aug 11, 2009 at 1:34 PM, Alejandro Imass alejandro.im...@gmail.com wrote: Well in Catalyst an action is usually mapped to a controller method, so I really don't understand your

Re: [Catalyst] Loading template according to request path

2009-08-11 Thread Matt Whipple
Eden Cardim wrote: On Tue, Aug 11, 2009 at 2:15 PM, Matt Whipplem...@mattwhipple.com wrote: Thanks everyone for your input, I'm certainly gathering that there is nothing preexisting that does what I'm looking to do. I'll continue to clean up my version and throw it on CPAN if it seems

Re: [Catalyst] Loading template according to request path

2009-08-11 Thread J. Shirley
On Tue, Aug 11, 2009 at 2:47 PM, Eden Cardim edencar...@gmail.com wrote: On Tue, Aug 11, 2009 at 2:15 PM, Matt Whipplem...@mattwhipple.com wrote: Thanks everyone for your input, I'm certainly gathering that there is nothing preexisting that does what I'm looking to do. I'll continue to