progress but still no joy (was Re: [Catalyst] still not sure if I have the hang of this ...)

Andreas Marienborg omega at palle.net
Wed Dec 28 09:50:29 CET 2005


I saw your other post, but figured I would comment some bits :)


On 28. des. 2005, at 07.46, Joe Landman wrote:

> I added a simple global list method to the db controller
>
> 	sub list : Global {
> 		use Data::Dumper;
> 		my ( $self, $c ) = @_;
>   		my (@all);
>  		 @all = test::Model::Database::Testing->search();
>   		$c->forward( 'test::View::Mason');

put this in the 'sub end : Private { } of your base application, so  
you dont have to do it for each controller you write :P This also  
ensures that everything you put in the stash is visible upon rendering.

You can also check out the DefaultEnd plugin, which is a grand idea :)

>   		$c->stash->{stuff}=Dumper(@all);

> 	}
>





More information about the Catalyst mailing list