[Templates] Variable interpolation question
Dave Cash
dave@gnofn.org
Tue, 3 Sep 2002 09:54:45 -0500 (CDT)
On Tue, 3 Sep 2002, Mark Mills wrote:
> > my %globals = (
> > user => $r->user,
> > users => "$users_ref"
> > );
> > <b>Assign To:</b> [% CGI.popup_menu("assignee", [% $users_ref %]) %]
> >
> > and he bombs out. Obviously I can't nest the
> > interpolation signs -- [% %] -- but what should I use
> > instead when I have a var that needs to be interpolated
> > into a context which itself is interpolated?
>
> Dennis,
>
> Maybe you should do:
>
> users => $users_ref
>
> without the quotes. Then, you should be able to do:
Good point about losing the quotes...
> [% CGI.popup_menu("assignee", users_ref) %]
...but shouldn't this be
[% CGI.popup_menu("assignee", users) %]
in the context of the %globals hash above? I wouldn't think the
name 'users_ref' would be visible in the template's namespace.
Dave
/L\_/E\_/A\_/R\_/N\_/T\_/E\_/A\_/C\_/H\_/L\_/E\_/A\_/R\_/N\
Dave Cash Power to the People!
Frolicking in Fields of Garlic Right On-Line!
dave@gnofn.org Dig it all.