[SOLVED] Twig: how to create fully qualified URL for path_for()?

Does anybody know what I have to do in Twig to create a fully qualified URL for path_for()? I’m looking to generate a URL like this:

https://mysite.com/routePath

Do I have to do this manually by concatenating the result of path_for() with base_url() or is there a smarter/prettier way?

Thanks in advance.

I’m pretty sure there is not. I don’t see anything in Twig-View/src/TwigExtension.php like that. It looks like @akrabat might have created a PR to Implement fullUrlFor() #1327 along those lines within Slim itself, but it wasn’t merged.

Thank you, I’ve taken the function you referenced and implemented a twig plugin on the basis of that (required a little hack, but OK, it works for now).

I’d just like to point out that such a function is quite important to have IMHO because if (as I’m doing) you’re generating emails with an action button, you need to refer to the full URL.

1 Like

In my email templates I just concatenate as you were doing. I agree with the use case, however.

OK, thanks for clarifying … as always, your help is appreciated.