[Catalyst] :Template() Attribute

Christopher H. Laco claco at chrislaco.com
Sun Jun 17 19:02:52 GMT 2007


Matt S Trout wrote:
> On Sat, Jun 16, 2007 at 08:37:46PM -0500, Jonathan Rockway wrote:
>> On Friday 15 June 2007 08:36:33 am Christopher H. Laco wrote:
>>
>>> OPTION #2: View::TT, View::Mason, View::**
>>> ----------------------------------------------
>>>
>>> PROS:
>>>
>>> Template() will be honored with the use of RenderView and the use of
>>> forwarding to a view manually (like in REST or other controller code).
>>>
>>> CONS:
>>>
>>> This has to be implemented in each View::** package that wants to
>>> support it.
>>>
>>> IF one changes from a view the support it, to one that doesn't,
>>> controllers go boom.
>>>
>> What we really need to do is add a utility method like template_name() t=
o the =

>> Catalyst::View base class.  Even without the :Template attribute, there =
is =

>> code duplicated between every view that shouldn't be( $template =3D =

>> $c->action || $c->stash->{template} ). =

> =

> I was pondering a base class but it shouldn't be ::View itself, since ::V=
iew
> is a base for things like JSON views where the concept of a template does=
n't
> (currently, anyway) make any sense.
> =


Well, if we're throwing things in the ring...

C::View::Templated

->template()

And some forms of:

->template_paths(\@)


that takes care of doin the pre/post additional_paths/INCLUDE/PATHS
jerkery...so views can all find their template paths from the same method...

-=3DChris

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


More information about the Catalyst mailing list