FAQ
Hiya all,

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?

-Devin

--
Devin Austin
Founder and Head Developer of CodedRight.net
http://www.codedright.net - get your web app Coded Right
http://www.dreamhost.com/r.cgi?326568/hosting.html - Host with DreamHost!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080320/cdb867a6/attachment.htm

Search Discussions

  • Ashley Pond V at Mar 20, 2008 at 7:21 pm

    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
  • Devin Austin at Mar 20, 2008 at 7:46 pm
    (Pardon the lack of quoting, GMail is flaking out on me)

    Re: attributes
    Aha. I think that's where I went wrong.

    Re: test stubs
    Agreed, however in a situation when I'm on my laptop (most of the day while
    I'm away from my room with my "real" computer) and I don't want to put
    myself through the pain of installing perl and Catalyst on Windows, I'd like
    to be able to create new controllers if need be so I don't have to limit
    development to my location.

    Anyway, thanks for the response. Much easier than trying to grok the murky
    depths that the Catalyst code appears as to me :-)

    -Devin
    On Thu, Mar 20, 2008 at 1:21 PM, Ashley wrote:

    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

    _______________________________________________
    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/

    --
    Devin Austin
    Founder and Head Developer of CodedRight.net
    http://www.codedright.net - get your web app Coded Right
    http://www.dreamhost.com/r.cgi?326568/hosting.html - Host with DreamHost!
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080320/b60a0a50/attachment.htm
  • Jonathan Rockway at Mar 20, 2008 at 10:17 pm

    * On Thu, Mar 20 2008, Devin Austin wrote:
    Agreed, however in a situation when I'm on my laptop (most of the day
    while I'm away from my room with my "real" computer) and I don't want
    to put myself through the pain of installing perl and Catalyst on
    Windows, I'd like to be able to create new controllers if need be so I
    don't have to limit development to my location.
    This doesn't sound like a good development methodology to me, but
    creating a controller is easy enough:

    package Whatever::Controller::Foo;
    use base 'Catalyst::Controller';
    # code goes here
    1;

    All the helpers do is type that in for you.
    Anyway, thanks for the response. Much easier than trying to grok the
    murky depths that the Catalyst code appears as to me :-)
    As an aside, the code in libraries is no different from the code you
    write yourself. If you're not afraid to write Perl, you shouldn't be
    afraid to read it.

    Regards,
    Jonathan Rockway

    --
    print just => another => perl => hacker => if $,=$"

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedMar 20, '08 at 7:12p
activeMar 20, '08 at 10:17p
posts4
users3
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase