RE: [htmltmpl] Writing an extension for HTML::Template - how to do it?
Brought to you by:
samtregar
From: Dan H. <dan...@re...> - 2005-11-08 22:33:30
|
Hi =20 Since you're using CGI::App, you should have a look at CGI::Application::Plugin::AnyTemplate - which will allow you to call a = run mode with the H::T =20 <TMPL_VAR NAME=3D"CGIAPP_embed('some_run_mode', 'param, 'param')"> =20 Dan =20 -----Original Message----- From: htm...@li... [mailto:htm...@li...] On Behalf Of Webmaster Techcode.NET Sent: Wednesday, 9 November 2005 11:16 To: htm...@li... Subject: [htmltmpl] Writing an extension for HTML::Template - how to do = it? Hello folks! =20 Don't know if it's just me or documentation of HTML::Template::Extension isn't good. Eitherway, I can't figure out how to write an extenstion for = it, that I need for my project.=20 =20 I work with CGI::Application, and I wan't to be able to use (reusable) objects in my templates. =20 For instance : =20 <tmpl_plugin name=3D"SomeName(param1, param2)"> =20 My filter would find SomeName module (Prefix such as MyApp::Plugin::SomeName) make an instance of it and call method - say = named run. And place returned value instead of this tag. =20 Think of it as another template file that is included but it has some processing ... That way I can create one module/plugin and use it = througth whole site/application. =20 =20 If I don't figure this out soon - I will have to give a shot to HTML::Template::Expr and register a function with it (<tmpl_var name=3D"plugin(SomeName, param1, param2)">). =20 Thanks. =20 |