Marcus Ramberg (marcusramberg) wrote,
Marcus Ramberg
marcusramberg

Another potential Catalyst feature.

The recommended best practice for Catalyst Views is to default to a template name based on $c->action, which stringifies to the private name of an action. The TT view also supports setting
TEMPLATE_EXTENSION
in the config, so with a template extension of '.tt', an action 'foo' in controller 'Bar' would default to render the template
/bar/foo.tt
. This works pretty well for most situations, but sometimes when you forward to another action, you'd like it to use that action's template instead, and to do this today, you would have to set the template manually in the action you call. However, once you start doing that, things get messy, and sometimes you want that action to forward to another action that sets the template.

To fix this, I propose to add a new function to catalyst, 'call'. It would work just like forward, except it sets $c->action to the new action. This would also mean that TT and other views that use $c->action would render the template associated with the new action.
Tags: catalyst
Subscribe

  • Angerwhale officially released

    Congrats to Jrockway on releasing Angerwhale. Angerwhale is a filesystem-based blog with integrated cryptography, built on the Catalyst framework.…

  • Hashing passwords on user creation.

    If you use Catalyst auth with hashed passwords, here's how to create the digest in your DBIx::Class user class automatically. sub store_column { my…

  • Couple of Catalyst powered sites.

    Even tho we haven't got the holy buzz of Rails, people seem to be putting up new Catalyst-powered sites all the time. I'll try to mention some as I…

  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 2 comments