Re: [htmltmpl] enhancements to H::T
Brought to you by:
samtregar
From: Sam T. <sa...@tr...> - 2003-12-09 18:39:14
|
On Tue, 9 Dec 2003, Mathew Robertson wrote: > - TMPL_ELSIF tag, eg <TMPL_ELSIF somevar> I've certainly had a lot of requests for this feature, but I'm still reluctant to include it. I think it would only enable people to build even more complex logic into their templates, which is not generally a good idea. > - support for custom tags, eg <TMPL_CATGETS ...> I'll be interested to see how you coded this. I'm not sure the current code base can support this cleanly... And even though I put it in my HTML::Template v3 design doc I'm still not sure it's a good idea. (Go figure) > - trailing slash in tags, aka <TMPL... /> This is trivially done in a filter, so there's no reason to add it to the core code. > - TVPL_VAR support for HTML=TEXT which allows paragraphs of text to be formatted to respect newlines This is easily done with HTML::Template::Expr and is too task-specific to go in the core code. I've done this task a few times and each time I've done it a little differently (<br> <br> vs. <p>, wrapping long lines vs. no wrap, etc.). > - dot syntax, eg 'user.name' Allowing dots in variable names seems harmless enough. > - dot syntax with autovivification of leading template variable, eg 'user.name' results in autovivification of 'user' I know you explained this to me earlier, but I still don't understand the value of this feature. So far HTML::Template hasn't cared what you name your variables and I'm somewhat loathe to start now. This is also something that's easily done with an overridden param() in a sub-class. > I have included documentation to support the enhancements. Also, I > have bumped the revision number to 2.7 so as to indicate a > non-standard release. Someday there will be an HTML::Template 2.7, so this isn't a good fake revision number. Something like 2.6_01 would be better. That's the standard CPAN notation for beta releases. -sam |