Cees Hek <[EMAIL PROTECTED]> writes: > I like this idea, although I have a suggestion for handling this in > a slightly different manner. By using the LOOP construct to > simulate namespaces, your namespace could get polluted if using > global_vars=1.
Polluted -- how? You mean by "seeing" upstream variables when their names don't clash with namespace-specific ones? I guess I consider that a feature, just like in "tmpl_loop". > <head><title><TMPL_VAR NAME="title"></title></head> > > Here the variable 'title' would be changed 'header:title' at parse time. So in > order to fill in the 'title' variable, you would pass a parameter to > HTML::Template called 'header:title'. The problem with this is that it breaks abstraction because the code that returns the include must be aware of the namespace the includer chose. In simple cases this can be solved by using "nparam", but in more complex ones the parameter itself will refer to further hash tables and arrays, some of which would then have to be created with an "nparam"-like function. One of the most important features of the NAMESPACE proposal is that it plays within the established bounds of HTML::Template. I.e. you form a namespace with a hashtable, and you are free to combine this hashtable with other elements, just like before. > Another possible solution would be to add a TMPL_NAMESPACE tag to do > this for any section of your templates, not just include files. I considered this for a time as well, but came to the conclusion that TMPL_NAMESPACE makes very little sense except to handle includes. > The main drawback that I see of adding namespaces to HTML::Template, > is that it complicates the syntax. Agreed. I still hope Sam will like the proposal -- "tmpl_include" tag isn't cluttered with parameters as it is, and I believe adding explicit namespaces is a genuine improvement, especially when using other people's includes. ------------------------------------------------------- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm _______________________________________________ Html-template-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/html-template-users
