> [% "<input type='hidden' name='matched_cols' value='[%
> inputs.values.join(',')' %]>" IF inputs %]

I'm hoping that TT3 will support that syntax.  CGI::Ex::Template does now 
(version 2.10 on CPAN).

But you have an error as it is.  You have

value = '[% inputs.values.join(',')' %]

The problem is that your single ticks are unbalanced and wouldn't parse.  
Change that line to

value = '[% inputs.values.join(',') %]'

The next thing you need to do is send that string to the eval filter so that 
it can parse the embedded tags.



The following works with CGI::Ex::Template today.

use CGI::Ex::Template;

my $str = qq{Line: [% "<input type='hidden' name='matched_cols' value='[% 
inputs.values.join(',').html %]'>"|eval IF inputs %]\n};

my $t = CGI::Ex::Template->new;

$t->process(\$str);
$t->process(\$str, {inputs => {key1 => 'val1'}});
$t->process(\$str, {inputs => {key1 => 'val1', key2 => 'val2'}});

Line:
Line: <input type='hidden' name='matched_cols' value='val1'>
Line: <input type='hidden' name='matched_cols' value='val2,val1'>

Just today I asked Andy off list if nested tags would be supported in TT3.  
They should be.  I hope they will be.

Paul

_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to