[Catalyst] Re: Dispatching based on path and host/domain

2008-04-23 Thread Aristotle Pagaltzis
* Matt S Trout <[EMAIL PROTECTED]> [2008-04-23 21:40]: > On Wed, Apr 23, 2008 at 03:25:47PM +0100, Curtis Fletcher wrote: > > Digging around, is it a sane thing to have: > > > > __PACKAGE__->_action_class('Catalyst::Action::MyAction'); > > > > At the top of a controller if I want all of the metho

Re: [Catalyst] TT custom virtual methods available to all pages.

2008-04-23 Thread Matt S Trout
On Wed, Apr 23, 2008 at 09:45:15AM -0500, Rajeev Cyrus wrote: > Greetings. > > One of my TT pages required some massaging of data that I decided to > do via referencing a subroutine in a template variable, eg: > $c->stash->{mk_hash} = \&mk_hash; > > I would like to use this stashed variable on

Re: [Catalyst] Dispatching based on path and host/domain

2008-04-23 Thread Matt S Trout
On Wed, Apr 23, 2008 at 03:25:47PM +0100, Curtis Fletcher wrote: > > -Original Message- > > From: Matt S Trout [mailto:[EMAIL PROTECTED] > > Sent: 23 April 2008 14:34 > > To: The elegant MVC web framework > > Subject: Re: [Catalyst] Dispatching based on path and host/domain > > > > :Local

Re: [Catalyst] TT custom virtual methods available to all pages.

2008-04-23 Thread Felix Antonius Wilhelm Ostmann
i love such liddle funktions as FILTER :) in View::TT __PACKAGE__->config( { CATALYST_VAR => 'catalyst', ... FILTERS => { yesno => sub { $_[0] ? 'yes' : 'no'; }, onoff => sub { $_[0] ? 'on' : 'off';

[Catalyst] Re: TT custom virtual methods available to all pages.

2008-04-23 Thread Aristotle Pagaltzis
* Rajeev Cyrus <[EMAIL PROTECTED]> [2008-04-23 16:55]: > Where is the best place to initialize and set this variable? In the `begin` action of your root controller? Regards, -- Aristotle Pagaltzis // ___ List: Catalyst@lists.

Re: [Catalyst] TT custom virtual methods available to all pages.

2008-04-23 Thread Peter Karman
On 04/23/2008 09:45 AM, Rajeev Cyrus wrote: > Greetings. > > One of my TT pages required some massaging of data that I decided to do > via referencing a subroutine in a template variable, eg: > $c->stash->{mk_hash} = \&mk_hash; > > I would like to use this stashed variable on all of my template

[Catalyst] TT custom virtual methods available to all pages.

2008-04-23 Thread Rajeev Cyrus
Greetings. One of my TT pages required some massaging of data that I decided to do via referencing a subroutine in a template variable, eg: $c->stash->{mk_hash} = \&mk_hash; I would like to use this stashed variable on all of my templates so my question is: Where is the best place to initia

RE: [Catalyst] Dispatching based on path and host/domain

2008-04-23 Thread Curtis Fletcher
> -Original Message- > From: Matt S Trout [mailto:[EMAIL PROTECTED] > Sent: 23 April 2008 14:34 > To: The elegant MVC web framework > Subject: Re: [Catalyst] Dispatching based on path and host/domain > > :Local is a shortcut for > :Path($controller->path_prefix.'/'.$method_name) > > Tho

Re: [Catalyst] Dispatching based on path and host/domain

2008-04-23 Thread Matt S Trout
On Wed, Apr 23, 2008 at 12:22:36PM +0100, Curtis Fletcher wrote: > > Write an Action Class. > > > > You can put whatever you want in the match() method. In your case, > > > > return 0 if grep { $c->req->host =~ /$_/ } > > @{$self->attributes->{Domain}||[]} > > I gave this a go (in principle it

RE: [Catalyst] Dispatching based on path and host/domain

2008-04-23 Thread Curtis Fletcher
> Write an Action Class. > > You can put whatever you want in the match() method. In your case, > > return 0 if grep { $c->req->host =~ /$_/ } > @{$self->attributes->{Domain}||[]} I gave this a go (in principle it looks ideal), but the documentation on Catalyst::Action is pretty sparse and only