How can I call a variable from other variables like in other languages in less?
PHP:
$name = 'stack';
$level = '900';
$nameVariable = $name . $level;
${$nameVariable}; // chama variável: $stack900
$$nameVariable; // chamar variável: $stack900
How can I call a variable from other variables like in other languages in less?
PHP:
$name = 'stack';
$level = '900';
$nameVariable = $name . $level;
${$nameVariable}; // chama variável: $stack900
$$nameVariable; // chamar variável: $stack900
Oops, after trying hard enough!
Less:
@name: stack;
@level: 900;
@nameVariable: ~'@{name}@{level}';
@@nameVariable; // chama variável: @stack900
The reason for using @{name}@{level}
instead of @name@level
is:
Example:
@{name}@{level} // stack900
@name@level // stack 900
and ~
is to remove the quotation marks ''