in reply to Squatting::On::Catalyst and Truly Modular Web Apps
But I dont think $v->{title} or $v->{message} are view. They should have been pulled from the model by the view. And they certainly dont belong in the controller, whose only job is to pick a particular model and view and let them do the work.# STEP 2 => Create a Controllers package { package App::Controllers; use Squatting ':controllers'; # Setup a list of controller objects in @C using the C() function. our @C = ( C( Home => [ '/' ], get => sub { my ($self) = @_; my $v = $self->v; $v->{title} = 'A Simple Squatting Application'; $v->{message} = 'Hello, World!'; $self->render('home'); }, post => sub { } ), ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Squatting::On::Catalyst and Truly Modular Web Apps
by beppu (Hermit) on Aug 14, 2008 at 21:06 UTC | |
by metaperl (Curate) on Aug 15, 2008 at 14:34 UTC |