DefaultRouteBundle is a project mainly written in PHP, it's free.
adds default route for Symfony2 application
This bundle adds a default automatic route like symfony 1. It routes automatically the url '/Hello/Hello/index' to index action of Hello controller of Hello bundle in your Application.
First, add this bundle to your project. If you use git, add this bundle to the submodule as follows.
$ git submodule add git://github.com/hidenorigoto/DefaultRouteBundle.git src/Xnni/DefaultRouteBundle
Then register this bundle in your AppKernel.
public function registerBundles()
{
$bundles = array(
// :
new XnniDefaultRouteBundleXnniDefaultRouteBundle(),
// :
);
Finaly, enable this bundle in your config(config.yml) as follows.
# defaultroute
defaultroute.config: ~
Note: Following new Symfony2 namespace convention, you have to add one line in the registerNamespaces() of your src/autoload.php.
'Xnni' => __DIR__,
If you made your application in following condition,
php app/console init:bundle App\HelloBundle src/
)then you can access this action with url such as http://localhost/app_dev.php/Hello/Default/index