Symfony2 Twig url() https
我需要生成一个使用安全 HTTP 协议的绝对 URL,因为它是第三方支付网关解决方案使用的支付页面模板,要求页面上的每个元素都指向或来自 HTTPS 链接。现在,我无法找到如何使用 Twig url() 函数生成安全 URL。您在数组中添加到函数中的任何内容都被视为 GET 参数,该参数将以 ?x=y 的方式附加在 URL 的末尾。
如何使用 Twig url() 函数生成 HTTPS URL?
I need to generate an absolute URL that will use the secure HTTP protocol since it's a payment page template used by a third party payment gateway solution that requires every single element on the page to point to or to come from an HTTPS link. Now, I can't for the life of me find how to use the Twig url() function to generate a secure URL. Anything you add to the function in an array is considered a GET parameter that will be appended at the end of the URL in a ?x=y manner.
How can I generate an HTTPS URL using the Twig url() function?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
twig 生成的 URL 由您的路由配置决定。您需要将路由设置为需要 https。
您可以在这里阅读更多相关信息:
http://symfony.com/doc/2.0/cookbook/routing/scheme.html
The URLs generated by twig are determined by your routing configuration. You need to set the route to require https.
You can read more about it here:
http://symfony.com/doc/2.0/cookbook/routing/scheme.html