On 2/27/06, Sam Tregar <[EMAIL PROTECTED]> wrote:
> On Sat, 25 Feb 2006, Brad Choate wrote:
> > First, for filters: a filter should be able to determine what file is
> > currently being processed, if the contents of the template did come
> > from a file.
>
> I guess that makes sense.  I'm curious though - what are you planning
> to do with this feature?

One of MT's biggest features is our plugin support. With an upcoming
release, plugins will be able to make changes to the application's
templates. To do this, the plugins can request to be notified when
processing a particular template. Ie, the "menu" template. There are
others though, such as the common header and footer templates that
they can also target, but these are pulled in through the TMPL_INCLUDE
tag.  I can use the HTML::Template filter parameter to know when the
includes are processed, but I don't know what filename is being loaded
at the time.



> > Second, for template vars that are coderefs.
> >
> > To me, these are a bit limited since the coderef has no way to
> > determine it's context.  I'm envisioning a scenario like this:
> >
> >    <TMPL_LOOP NAME=X>
> >        <TMPL_VAR NAME=CODE_FOO>
> >    </TMPL_LOOP>
> >
> > The coderef associated with 'code_foo' is called for each iteration of
> > the array in parameter 'x', but 'code_foo' has no way to access the
> > active row of data.
>
> This seems less obviously useful to me.  If the data-structure for
> loop X is so complicated then why make it more complicated by using
> code-refs?  Why not just bake it all into the structure you pass to
> param() in the first place?
>
> I should admit, I very rarely use code-ref params in my work.  They
> seem to have a very limited utility.  I used them to implement
> HTML::Template::Expr, but I wouldn't say I'm proud of that fact!

I don't use them either-- I just found out HTML::Template supported
them! I just find it odd that the coderef has no means to determine
the context in which it was invoked. Perhaps if it could, it would be
more useful? The current implementation seems to be just enough
implementation to support HTML::Template::Expr and nothing more.


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to