I would like to provide functionality to multiple controllers. Imagine, you
have a funny class "Funny.pm" as __part of your catalyst app__ .
I could create the helper class in a directory below my app e.g.
/Cat/Helper/Funny.pm
Then, I could use the class in a Controller "Test":
---
package Cat::Controller::Test;
use strict;
use warnings;
use base 'Catalyst::Controller';
use Cat::Helper::Funny; ## <-- this is the funny class
sub index : Private {
my ( $self, $c ) = @_;
# do funny stuff
my $fun = Cat::Helper::Funny->new( %some_params );
my $funny_result = $fun->do_calculate();
# .... some more steps ...
}
1;
---
My questions:
- Is this a could way to solve the problem? (may be best practice?)
- Any other suggestions?
Stefan
--
-----------------------------------------------------------------------------
Stefan Kuehn - Le Duc de Brême
The Calendar of Historical Dance -- http://www.early-dance.de
-----------------------------------------------------------------------------
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/