Closed killua-eu closed 4 years ago
I think url_for doesn't exists anymore, it should be path_for.
Can you try to replace url_for
with path_for
?
Sorry for the late reply. Its the other way around, path_for doesn't exist any more (at least not in the latest https://github.com/slimphp/Twig-View#custom-template-functions Using path_for gets me
Twig \ Error \ SyntaxError
Unknown "path_for" function.
when rendering a page, so there's no backward compat too I could rely on.
As first I would recommend that you use the the same container instance as you would use for your Slim app. Don't build a new container for this special use case. If you use the same container and app instance then it should work like in your application.
PS: I just updated the example: https://github.com/odan/twig-translation/blob/master/README.md#parsing-twig-files
Uh, wow. I was actually building a container and including the slim app one a few lines later. I honestly didn't see that. Probably some really bad kind of code dyslexia or ... (fill in your favourite excuse for looking at your code without actually reading in).
For some reason the path_for / url_for thing disappeared too and I'm unable to replicate it. Sorry for the confusion, closing this issue.
I modified the
bin/parse-twig.php
suggested in https://github.com/odan/twig-translation#parsing-twig-files slightly to fit into my app (https://github.com/vaizard/glued-skeleton/blob/master/glued/Core/Bin/parse-twig.php). Upon running the script, I'm gettingI'm not sure why I get the
Unknown "url_for" function
error. It seems that the slimphp/Twig-View somehow doesn't get loaded, even though I'm getting $twig from the container, so I should be 1:1 with the rest of the app. I'm really at loss how to fix this. Got any ideas you could kindly suggest?Thanks, P.