SMARTY: Variable inside variable

427 Views Asked by At

Is it possible to use a variable inside smarty?

EX: {assign var="delivery_country" value=$customer.addresses.{$delivery_id}.country}}

As you can see i've added {$delivery_id} inside {$customer.addresses.country}

Is this possible?

1

There are 1 best solutions below

0
Boryss96 On

Yes, it is possible.

{assign var="delivery_country" value={$customer.addresses.{$delivery_id}.country}}