Adrian,

Adrian Tarau wrote:
I have the following problem : I would like to call a macro but the macro
name must be a variable.

This is more of a question for the user's list, not the dev list. In the future, please post there.

Ex: instead of #renderLabel($component) to have #call("renderLabel"
$component) - of course "renderLabel" can be any (existing) macro name.

How many possibilities can you have for $component? Are they unlimited, or constrained to maybe 5 possibilities? I'm wondering because you could easily do it like a switch:

#if('renderLabel' == $macroToCall)
#renderLabel($component)
#elseif('renderInput' == $macroToCall)
#renderInput($component)
#elseif(...)
...
#end

-chris

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to