I have two packages in sf2, each of which has the same route. Example: / blog
Bundle A
user_blog: pattern: /blog defaults: { _controller: UserBlogBundle:Default:blog }
Bundle b
team_blog: pattern: /blog defaults: { _controller: TeamBlogBundle:Default:blog }
and with the session parameter I find out which of the packages will run the request
excuse me,
I want to run the correct package according to the session parameter
Example
{{ if($Parameter ='A') run user_blog else run team_blog }}
I'm doing it:
//src/project/TestBundle use Symfony\Component\Routing\RouteCollection; $collection = new RouteCollection(); $req = $this->getRequest(); if($req->server->get('SERVER_NAME') == 'www.domainA.com') $collection->addCollection($loader->import("@BundleABundle/Resources/config/routing.php")); else $collection->addCollection($loader->import("@BundleBBundle/Resources/config/routing.php")); return $collection;
is this common
source share