加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – Symfony2子域路由 – 不同的捆绑包

发布时间:2020-12-13 13:20:16 所属栏目:PHP教程 来源:网络整理
导读:编辑 现在有可能在symfony 2.2中这样做 PlatformFooBundle: resource: "@PlatformFooBundle/Resources/config/routing.php" domain: foo.testdomain.comPlatformBarBundle: resource: "@PlatformBarBundle/Resources/config/routing.php" domain: bar.testdo
编辑
现在有可能在symfony 2.2中这样做
PlatformFooBundle:
    resource: "@PlatformFooBundle/Resources/config/routing.php"
    domain: foo.testdomain.com

PlatformBarBundle:
    resource: "@PlatformBarBundle/Resources/config/routing.php"
    domain: bar.testdomain.com

PlatformBazBundle:
    resource: "@PlatformBazBundle/Resources/config/routing.php"
    domain: baz.testdomain.com

您也可以使用域中的参数

编辑过

在将此标记为重复之前,请继续阅读

http://www.craftitonline.com/2011/08/symfony2-locale-on-subdomains-not-on-the-url-path/

我读过这篇文章,但它并没有帮助我做我想做的事情.

我有3个不同的应用程序在相同的域名上运行,具有单独的子域名.目前,他们都在自己的symfony安装中运行,我想摆脱它.

foo.testdomain.com
bar.testdomain.com
baz.testdomain.com

每个都使用不同的捆绑

PlatformFooBundle
PlatformBarBundle
PlatformBazBundle

他们每个人都有自己的路线定义.

基本上,我想要的是这个

PlatformFooBundle:
    resource: "@PlatformFooBundle/Resources/config/routing.php"
    subdomain: www|devwww

PlatformBarBundle:
    resource: "@PlatformBarBundle/Resources/config/routing.php"
    subdomain: bar|devbar

PlatformBazBundle:
    resource: "@PlatformBazBundle/Resources/config/routing.php"
    subdomain: baz|devbaz

我该怎么做呢?

有一个 discussion继续添加此功能.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读