#2 <TMPL_INCLUDE Name=<PERL Variable>>

open
nobody
None
5
2003-01-16
2003-01-16
No

Hi.
I am now working on a CMS project based on HTML::TEMPLATE.
It works quite fine.
BUT
I am always having the same question over and over again.

I would like to include a file which name should be
given by a PERL Variable.
My aim is to get a Template file like this :
<TMPL_LOOP Name=myloop>
........
<TMPL_INCLUDE Name=myname>
....
</TMPL_LOOP>

and perl code as such :
my @myloop;
for $i (dir){
my %hash;
$hash{myname}=$i;
push (myloop, \%hash);}
$template->param(myloop=>\@myloop);

It seems quite a specific feature.
But considering TMPL_INCLUDE as special vs other tmpl
which uses Perl variable names seems quite confusing.
I saw it was questioning for people in the forum.
And in my case, using a filter is not a solution, or
even the solution to open many template files doesn't
meet my demands.

So, would it be too hard a job to implement this feature ?
Since you made it specific, is there a reason for that ?
If you think it is a good idea, but don't have time to
devote to it, please, provide me with advice and docs
and I could work on it.

Thanks for your answer.
Henri-Damien LAURENT

Discussion


Log in to post a comment.