Re: [Catalyst] accessing methods in another controller?

2007-08-05 Thread Ash Berlin
Alan Spector wrote:
 Hi all,
 
 I had a quick question, what is the best way within a Controller to  
 access  a method in another controller?  or is it better to put the  
 method (it's a fetch for data in a particular format) in my Model?
 
 tia,
 
 alan
 

$c-controller('OtherController')-foo($c)

Its that simple. There is a $c-forward method (look in Catalyst.pm for
docs) but most of the time you don't need to use it.

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] accessing methods in another controller?

2007-08-05 Thread Alan Spector

Hi all,

I had a quick question, what is the best way within a Controller to  
access  a method in another controller?  or is it better to put the  
method (it's a fetch for data in a particular format) in my Model?


tia,

alan


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] accessing methods in another controller?

2007-08-05 Thread Matt S Trout
On Sun, Aug 05, 2007 at 10:59:50AM -0400, Alan Spector wrote:
 Hi all,
 
 I had a quick question, what is the best way within a Controller to  
 access  a method in another controller?  or is it better to put the  
 method (it's a fetch for data in a particular format) in my Model?

What ash said, but I'd probably push it into the model anyway.

Generally the controller should be application control flow logic and
very little else.

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical DirectorWant a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/ 

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/