[Catalyst] Access controllor logic from script

Zbigniew Lukasiak zzbbyy at gmail.com
Tue Jan 24 13:32:17 CET 2006


In my opinion all web independent code should go into the Model.  The
Controller by definition is web dependent and calling it's methods
from outside of web request means you need to create dummy web request
environment - it is easier to just take the logic out.

-- Zbyszek

On 1/22/06, Juan Camacho <jc5826 at gmail.com> wrote:
> Is it possible access logic inside a controller from a Perl command
> line script?  For example, run the 'records' method below:
>
> package MyApp::C::Search;
>
> sub records {
>   my ($self, $c) = @_
>   ... logic here that uses $c->req->params & $c->stash
> }
>
> I solved this by moving the logic to it's own Catalyst agnostic
> module, but I'm curious if there might have been a better way and the
> answer may have an impact on how I design my code in the future.
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
>


More information about the Catalyst mailing list