PHPackages                             senj/dynamic-subdomain-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. senj/dynamic-subdomain-bundle

ActiveSymfony-bundle[Framework](/categories/framework)

senj/dynamic-subdomain-bundle
=============================

Symfony3 Dynamic subdomain handler Bundle

1.0.0(9y ago)197MITPHPPHP &gt;=5.5.9

Since Feb 26Pushed 9y ago1 watchersCompare

[ Source](https://github.com/senj-gold/dynamic-subdomain-bundle)[ Packagist](https://packagist.org/packages/senj/dynamic-subdomain-bundle)[ Docs](https://github.com/senj-gold/dynamic-subdomain-bundle)[ RSS](/packages/senj-dynamic-subdomain-bundle/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Dynamic subdomain handler for Symfony 3
=======================================

[](#dynamic-subdomain-handler-for-symfony-3)

Install
-------

[](#install)

In `composer.json`:

```
"require": {
    "senj/dynamic-subdomain-bundle": "dev-master"
}
```

In `app/AppKernel.php`:

```
$bundles = array(
    # [...]
    new Senj\DynamicSubdomainBundle\SenjDynamicSubdomainBundle(),
    # [...]
);
```

Configure
---------

[](#configure)

In app/config.yaml

```
senj_dynamic_subdomain:
    base_host: domain.com
    parameter_name: ~
    entity: Acme\DemoBundle\Entity\MySite
    property: ~
```

- `base_host`:

    - The domain base host, where all subdomains are attached
    - **required**
    - example: `domain.com`
- `parameter_name`:

    - The name of the parameter that will be set on the current `Request`
    - **optional**
    - default value: `subdomain`
- `entity`:

    - The class or Doctrine alias of the entity mapped to subdomains
    - **required**
    - example: `Acme\DemoBundle\Entity\MySite`
- `property`:

    - The name of the property storing the subdomain name in your entity
    - **optional**
    - default value: `subdomain`
- `method`:

    - The name of method that will be called to get object with the property defined
    - **optional**
    - default value: `findOneBy`

Use
---

[](#use)

1. Create the entities mapped to your subdomains
2. Get the current subdomain object through the Symfony `Request` object

In php, assuming that `senj_dynamic_subdomain.property` equals `subdomain` (the default value):

```
use Symfony\Component\HttpFoundation\Request;

class DefaultController extends Controller {

    public function indexAction(Request $request) {
        $subdomainobject = $request->attributes->get('subdomain');
        var_dump($subdomainobject);
    }
```

In twig, assuming that `senj_dynamic_subdomain.property` equals `subdomain` (the default value), and that the entity mapped to subdomains has a `title` property:

```
{{ app.request.attributes.get('subdomain').title }}
```

Notes
-----

[](#notes)

If the subdomain is not found in the database, an exception will be thrown by the Bundle (`Symfony\Component\HttpKernel\Exception\NotFoundHttpException`).

###  Health Score

27

—

LowBetter than 46% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3456d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5556013?v=4)[Lukas Zaiser](/maintainers/senj)[@senj](https://github.com/senj)

---

Top Contributors

[![senj-z](https://avatars.githubusercontent.com/u/5604514?v=4)](https://github.com/senj-z "senj-z (8 commits)")

---

Tags

symfonysubdomain

### Embed Badge

![Health badge](/badges/senj-dynamic-subdomain-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/senj-dynamic-subdomain-bundle/health.svg)](https://phpackages.com/packages/senj-dynamic-subdomain-bundle)
```

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M232](/packages/sulu-sulu)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

12017.1k](/packages/rcsofttech-audit-trail-bundle)[sulu/skeleton

Project template for starting your new project based on the Sulu content management system

29736.0k](/packages/sulu-skeleton)[shopware/storefront

Storefront for Shopware

674.7M283](/packages/shopware-storefront)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M668](/packages/shopware-core)[ecotone/symfony-bundle

Ecotone for Symfony — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Symfony Messenger, via PHP attributes.

11258.2k1](/packages/ecotone-symfony-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
