[Catalyst] :Template() Attribute

John Napiorkowski jjn1056 at yahoo.com
Mon Jun 18 14:36:56 GMT 2007


--- Zbigniew Lukasiak <zzbbyy at gmail.com> wrote:

> When we are at this View refactoring.  When changing
> the template you
> need to put the whole path on stash ( $c->stash(
> template =
> template_path/template.tt) ).  What I would propose
> is that the view
> automatically used the $c->action->namespace as the
> template_path - so
> that you would not need to specify the full path -
> only the template
> name.
> 
> This would mean less typing in most common case but
> also should be
> useful when inheriting from a base controller -
> since it would
> automatically adjust the template paths - and that
> is what you need in
> most cases as well.  The ideal would be if it would
> search the
> template directories of respective controller
> classes in the
> inheritance tree - but I have no idea how to
> accomplish that.

I'm not sure how far we want to go; do we want one
uber base class or a simple base with 'plugins' for
extra behavior?  Because I can think of lots of stuff
I'd like to use for some situations.  For example I
have cases where for all templates in a given
directory I want to set a particular WRAPPER for my
Template toolkit, etc.

--john

> 
> --
> Zbyszek
> 
> On 6/17/07, Jonathan Rockway <jon at jrock.us> wrote:
> > On Sunday 17 June 2007 01:02:52 pm Christopher H.
> Laco wrote:
> > >
> > > Well, if we're throwing things in the ring...
> > >
> > > C::View::Templated
> > >
> > > ->template()
> > >
> > > And some forms of:
> > >
> > > ->template_paths(\@)
> > >
> >
> > I like this.  Should we put this in a separate
> package, or right in C-Runtime?
> >
> > Incidentally, you could do
> $c->view->template('...')* instead of
> > $c->stash->{template}, which looks pretty nice.
> >
> > * or $c->view('View::TT')->template('...') if you
> don't like default_view.
> >
> > --
> > package JAPH;use Catalyst
> qw/-Debug/;($;=JAPH)->config(name => do {
> > $,.=reverse qw[Jonathan tsu rehton lre rekca
> Rockway][$_].[split //,
> > ";$;"]->[$_].q; ;for
> 1..4;$,=~s;^.;;;$,});$;->setup;
> >
> > _______________________________________________
> > List: Catalyst at lists.rawmode.org
> > Listinfo:
> http://lists.rawmode.org/mailman/listinfo/catalyst
> > Searchable archive:
>
http://www.mail-archive.com/[email protected]/
> > Dev site: http://dev.catalyst.perl.org/
> >
> 
> 
> -- 
> Zbigniew Lukasiak
> http://brudnopis.blogspot.com/
> 
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo:
> http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
>
http://www.mail-archive.com/[email protected]/
> Dev site: http://dev.catalyst.perl.org/
> 



       
____________________________________________________________________________________
Get the free Yahoo! toolbar and rest assured with the added security of spyware protection.
http://new.toolbar.yahoo.com/toolbar/features/norton/index.php



More information about the Catalyst mailing list