m4nu/multi-domain-bundle

为Symfony Cmf RoutingBundle添加多域名功能

1.2.0 2022-09-29 13:54 UTC

This package is auto-updated.

Last update: 2024-09-12 14:39:17 UTC


README

Build Status

此包根据MIT许可证授权。

MultiDomainBundle为Symfony Cmf RoutingBundle提供多域名功能。

要求

  • Symfony ~2.3
  • SymfonyCmfRoutingBundle ~1.2
  • 请参阅composer.json的“require”部分。

安装

获取包

在您的composer.json中添加以下行

{
    "require": {
        // ...
        "m4nu/multi-domain-bundle": "dev-master",
    }
}

初始化包

要开始使用此包,请在您的应用程序的kernel类中注册该包

// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new M4nu\MultiDomainBundle\M4nuMultiDomainBundle(),
    );
)

配置

# app/config/config.yml
m4nu_multi_domain:
    domains:
        en: www.example.org
        fr: fr.example.org
    persistence:
        phpcr:
            enabled: true