appventus/multi-domain-bundle

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Handle multiple dns site management

Installs: 17

Dependents: 0

Suggesters: 0

Security: 0

Stars: 8

Watchers: 5

Forks: 2

Type:symfony-bundle

dev-master 2019-01-23 14:12 UTC

This package is not auto-updated.

Last update: 2021-09-17 23:42:59 UTC


README

This bundle provide multiple domain behavior for Symfony2 applications.

Installation

add

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

in your composer.json or composer require appventus/multi-domain-bundle

register the bundle adding it to your bundles.php file

return [
	[...]
	AppVentus\MultiDomainBundle\AvMultiDomainBundle::class => ['all' => true],
];

and add the DomainTrait to all your domain managed entities:

/**
* Page
*
* @ORM\Table()
* @ORM\Entity
*/
class Page
{
    use \AppVentus\MultiDomainBundle\Traits\DomainTrait;
    
    [...]
}

Annnnnnd, it's done !

Your Page entity will now be available only if his domain is the same as the request domain.

Have fun !