Config CONS and use in Macro

Notice: This thread is very old.
Mikos
Member | 10
+
0
-

Hello,
Is it possible create some Constant in Config and use it in Latte Macro? I m absolute beginner in Nette :) so please give me some patience :). (1–2 weeks cca)

Example of what i want to do.

Constant:
PORTFOLIO_LINK: http://www.my-portfolio-link.cz/

And then use it in my template.

<a href="{portfolioLink}">Portfolio here </a>

For Latte-Macro i ready this topic https://latte.nette.org/en/develop#…

Ty for help and sorry for my english :)

Oli
Member | 1215
+
0
-

Hi,
i'm not sure, but i think that is possible something like

nette:
    latte:
        macros:
            - CustomMacros::install(%portfolioLink%)
public static function install($portfolioLink, Latte\Compiler $compiler)
    {
        $set = new static($compiler);
        $set->addMacro('id', NULL, NULL, array($set, 'macroId'));
    }
Mikos
Member | 10
+
0
-

Thank you, but i created properties in config.neon and called in BasePresenter and save in template variable.

Next time i try your technic :)

Ohh :D How to use past tense in sentence with more verbs :D Dah, I believe that it's ok.