I want to use a macro, but I get an error. I have a Volt filter:
$volt->getCompiler()->addFilter('trans', function ($resolvedArgs, $exprArgs) {
return '$this->translator->translate(' . $resolvedArgs . ')';
});
{{ "Something"|trans }}
The code above works fine in simple template, but doesn't work in a macro, because $this is undefined. Also in macros doesn't work some functions like "url()".
How to fix this behavior?
Phalcon 1.2.0.