in reply to Re: Catalyst: model & context object usage
in thread Catalyst: model & context object usage
sub list : Local { # Retrieve the usual Perll OO '$self' for this object. $c is the C +atalyst # 'Context' that's used to 'glue together' the various components # that make up the application. my ($self, $c) = @_; # Retrieve all of the book records as book model objects and store + in the # stash where they can be accessed by the TT template $c->stash->{books} = [$c->model('DB::Books')->all]; # Set the TT template to use. You will almost always want to do th +is # in your action methods (action methods respond to user input in # your controllers). $c->stash->{template} = 'books/list.tt2'; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Catalyst: model & context object usage
by actualize (Monk) on Aug 11, 2008 at 06:49 UTC | |
by marscld (Beadle) on Aug 11, 2008 at 07:37 UTC | |
by actualize (Monk) on Aug 11, 2008 at 16:12 UTC | |
by marscld (Beadle) on Aug 12, 2008 at 01:30 UTC | |
by actualize (Monk) on Aug 12, 2008 at 02:22 UTC | |
|