2009/2/19 Kieren Diment <dim...@gmail.com>:
>
> On 19/02/2009, at 9:31 PM, Dermot wrote:
>
>> Hi,
>>
>> I have an import script, MyApp/script/import.pl. I have found myself
>> replicating about 40% of it's code into a Controller. Is there some
>> way I can unify things and access subroutines from my controller in my
>> import.pl or the vice versa?
>
> Yes, been there and done that.  Write a standalone model (e.g. in
> Myapp/MyStandaloneModel.pm) that you can use the bulk of the code in the
> controller and the script.  Use Catalyst::Model::Adaptor and ACCEPT context
> to get the logic of this standalone model out of the controller and into the
> catalyst model.

Great thanx. I'll get straight to work on it. I might have a question
or two later about the config.
Dp.

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to