[Catalyst] Extending Catalyst -- new elements

Sir Robert Burbridge rburbrid at cisco.com
Thu Jun 17 19:22:08 GMT 2010

Looking through the catalyst docs, it looks like trying to use the =

_create.pl script to create elements other than models, views, and =

controllers is discouraged =

m#HELPERS).  =

Here's an excerpt.

    All helper classes should be under one of the following namespaces.


I'm trying to canonize some best practices with my team at work =

(thankfully we've just decided to move from vanilla-cgi to Catalyst, =

Moose, DBIx::Class, etc.).  I want to create some helpers for common =

application elements (such as forms, for example -- I'm moving us =

towards HTML::FormHandler).

I'd like our structure to be something like:


I realize that HFH says "FormHandler does not provide a custom =

controller for Catalyst because it isn't necessary. Interfacing to =

FormHandler is only a couple of lines of code" -- but I don't quite =

understand why I /wouldn't/ want one.

It makes sense to me that I would be able to create a new form this way:

    script/myapp_create.pl form Auth::Login HTML::FormHandler

(or something).  That would help to enforce the practice of putting form =

stuff in the MyApp::Form:: namespace.  As a helper, it doesn't really =

seem to fit well with either Model, Controller, or View, so it seems as =

though it would warrant being it's own element (I'm thinking along the =

lines of Reaction or MVVM).

My questions are:
* Would this kind of functionality be better done in =

Catalyst::Helper::(Model|View|Contoller):: or somewhere else?
* Why?
* Where can I read about how to put this wherever it should go?



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100617/54829=

More information about the Catalyst mailing list