Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Subdomain routing bundle for Symfony2.

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

How to install

Add the following lines to your deps file:


Run the command:

php bin/vendors install

Add the following two lines to your parameters.ini(in app/config folder)

router.options.generator_base_class = ITZ\RouterBundle\Component\Routing\Generator\UrlGenerator
router.options.matcher_dumper_class = ITZ\RouterBundle\Component\Routing\Matcher\Dumper\PhpMatcherDumper

Add the following line to the autoload.php file

'ITZ'                 => __DIR__.'/../vendor/bundles'

Add one method - getParent to you bundle to make your bundle inherit from Symfony FrameworkBundle, for example

    # src/Acme/DemoBundle/AcmeDemoBundle.php

    namespace Acme\DemoBundle;

    use Symfony\Component\HttpKernel\Bundle\Bundle;

    class AcmeDemoBundle extends Bundle
        public function getParent()
          return 'FrameworkBundle';

You are done.

Quick example

    pattern:   /something/{slug}
    defaults: { _controller: AcmeDemoBundle:Something:something }
      _host: http://{subdomain}
      subdomain: /^option1|option2$/
      _scheme: http


 * @Route("/something/something", name="_some_route",  requirements = {"_host" = "" })
 * @Template()
public function somethingAction()
    return array();
Something went wrong with that request. Please try again.