Config CONS and use in Macro
Notice: This thread is very old.
- Mikos
- Member | 10
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
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'));
}