Save {link} macro output to {var} variable in latte?

5 years ago

bukaJ
Member | 44
+
0
-

I have much complicate {link} macro with lot of parameters. I dont want repeat this code n-times in template but i need put same link to more anchors in page. Is possible some way to save {link} to variable in latte syntax?

Just like as

{var $xyz = {link ...}}

I know, this example is not working.

Now i building link in presenter, that is working good, but i dont want keep that in presenter.

5 years ago

Eda
Member | 212
+
0
-
{capture $xyz}{link ...}{/capture}

:-)

5 years ago

enumag
Member | 2128
+
0
-
{var $xyz = $control->link(...)}

5 years ago

bukaJ
Member | 44
+
0
-

Yeah. That's it!

enumag wrote:

{var $xyz = $control->link(...)}