[Catalyst] Catalyst::View::Templated

Jonathan Rockway jon at jrock.us
Sun Aug 19 02:31:32 GMT 2007

A while ago, we talked about creating a View base class that would
provide all the common features needed when dealing with
template-engine-based views.  Well, that's on CPAN now as
Catalyst::View::Templated. =

Here's a quick overview of the features; see the POD for all the details:

* provides render and process, you only need to implement a simple
_render method
* provides template-finding logic ($c->view->template or
$c->stash->template or $c->action. $self->{TEMPLATE_EXTENSION})
* handles exceptions (you don't have to worry about Catalyst, just die
and The Right Thing Will Happen)
* slightly cleaner API, instead of $c->view->render($c, $template), it's
$c->view->render($template) (although the first still works)
* common config elements; CATALYST_VAR, TEMPLATE_EXTENSION,
* process sets the charset *correctly*, not incorrectly like many Views :)
* lots of tests

This is all still somewhat experimental, so if you don't like something,
let me know.

For now, CPAN has Template::Declare and MicroMason which use this API,
and I'll probably convert ClearSilver over tonight also.  I tried TT,
but it's too messy for me to maintain backcompat... so it would be nice
if someone else would tackle that :).  I haven't looked at Mason yet,
but will.

Repository is at git.jrock.us until I move it to the Catalyst git server.

Jonathan Rockway

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 370 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070818/f616=

More information about the Catalyst mailing list