[Catalyst] Auth with Chained dispatch

Evan Carroll evan at dealermade.com
Sat Oct 21 18:39:41 CEST 2006


        I'm trying to refactor to simplify repeated code. What I want
        to do is have something like /item/edit/23 and /user/edit/87
        (repeated over many different actions and perhaps even tables,
        like /catalog/user/edit/23 vs. /phonelist/user/edit/23), so
        that instead of totally separate but almost identical methods
        (like I have now), I'll have one thing that goes to "item"
        or "user" (and/or "catalog" or "phonelist") and fills the
        stash with any relevant things, so that I can have one "edit"
        that does the work, but with whatever sort of table info is
        appropriate.
        
        
Thats a bad idea. You should refactor to /item_type/unique_number/edit,
that way if your doing something other than /edit, like /view,
or /export, or such the same code that retrieves the /unique_number/ can
be reused throughout the chain

Evan Carroll





More information about the Catalyst mailing list