Re: loop_context_vars

"Jamie Krasnoo" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.html-template
Message-ID <[email protected]>
Here's a short example.

my $template = HTML::Template->new( 'filename' => 'some.tmpl',
'loop_context_vars' => 1);

my $some_funky_loop = [..#array ref of hashrefs of stuff#.. ];

$template->param('SOME_LOOP' => $some_funky_loop);

$template->output();

# template

<!-- TMPL_LOOP NAME="SOME_LOOP" -->
   <!-- TMPL_VAR NAME="__counter__" -->
   <!-- TMPL_VAR NAME="some_var" -->
   <!-- TMPL_VAR NAME="another_var" -->
<!-- /TMPL_LOOP -->

On 8/30/06, Di Domenico, Michael <[email protected]> wrote:
>
>
>
>
> I'm trying to use the loop_context_var option for HTML::Template.
> Specifically I'm looking at the __counter__ option.  When I do a dump on my
> hashref, I can see that it's adding __counter__ along with the other vars,
> however, the counter var is always 'undef'.
>
>
>
> Is it supposed to be like this?  If so, does anyone have an example of its
> use?  I can't seem to find one on the web anywhere.
>
>
>
> Thanks
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>
> _______________________________________________
> Html-template-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/html-template-users
>
>
>

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
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.