[Catalyst] Catalyst controllers - can they be created without
catalyst.pl helper script?
Ashley
apv at sedition.com
Thu Mar 20 19:21:36 GMT 2008
On Mar 20, 2008, at 12:12 PM, Devin Austin wrote:
> I was playing around the other day when I tried to create a simple
> controller with out using the Catalyst.pl helper script. It wasn't
> loaded when I restarted my devel server, so I figured that there
> must be a dispatch table somewhere storing the names of the
> Controller files, and that table is edited by the helper script.
>
> Is this correct? Or is there some other method used to create
> controllers? Also, does one *have* to use the helper script to
> create controllers/models/views?
There's no dispatch table outside of the Controller tree. You don't
have to use the helpers at all but you do have to include an
attribute declaration for actions to be found. Making a controller of
Foo.pm with an action of bar-
This won't be found-
sub bar {}
This will be (at /foo/bar)-
sub bar : Local {}
You also don't need to manually restart the dev server if you launch
it with the -r flag. It will pick-up changes in your tree and restart
for you.
One of the main advantages, to me, of the helpers is that they stub
tests for you.
-Ashley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080320/1e8eff75/attachment.htm
More information about the Catalyst
mailing list