FAQ

On Jul 16, 2007, at 9:26 AM, Christopher H. Laco wrote:

Matt S Trout wrote:
On Mon, Jul 16, 2007 at 02:48:50PM +0200, Daniel McBrearty wrote:
is there a way to have some C's and M's load into catalyst
conditionally? for example, if some config variable is set?
Exclude some of them with setup_components config.

Or just do it via @INC manipulation - I use this a fair bit for
testing.

Depends what you're trying to achieve really, and you haven't told
us :)
Actually, this has me curious as well. In my case, I'd like to load
"Setup" controllers only when someone passes a --setup arg...so they
can use the web based config once, deliberately. After that, just
loading the app wouldn't expose those controllers to the world
accidentally.
This is one technique that I've used for having controllers that are
only enabled while in debug mode, seems simple enough to change the
condition that disables it. Just put this in the controller class...

sub register_actions {
my ( $self, $c ) = @_;

if ( ! $c->debug ) { return }
return $self->SUPER::register_actions( $c );
}

--
Jason Kohles
email@jasonkohles.com
http://www.jasonkohles.com/
"A witty saying proves nothing." -- Voltaire

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 8 of 8 | next ›
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedJul 16, '07 at 1:48p
activeJul 18, '07 at 2:51a
posts8
users6
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase