Re: Writing an extension for HTML::Template - how to do it?

Mathew Robertson <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.html-template
Organization Nielsen//NetRatings
Message-ID <[email protected]>
>>Anyway - I already looked into that. It's what CGI::Application::Framework uses.
>>But it's not what I need/want.
>>
>>That way I can only call some run_mode (method) from current module (one that is outputing
>>the template in the first place).  I would need to manualy add plugins to each of the module
>>(or just in base module). 
>>
>>
>>On the other hand, I could write an method in my base module (inherited by others). And implement
>>that logic inside of him (require SomeModule, call some_run_mode in it ...).
>>    
>>
>
>I don't know how much flexibility you need. I have a limited number of
>run modes that my templates embed so I just place them in my base class.
>I guess you could import them into your namespace or perhaps other list
>members have more elegant solutions - I'm sure that there is one though
>  
>
Indeed, there are a number of solutions that can be implemented.  
HTML::Template::Expr with a function callback is probably the easiest 
solution.

Another possiblility is to use the modified H::T that I use (available 
at  http://members.optusnet.com.au/~mathew) to create your own TMPL_xxx 
syntax.

Mathew
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.