Abhoryo/APYDataGridBundle — pull request #513 by Bup3 (2014-03-10 12:53:18+00:00)
Title: Fixed bug with unused grid route parameters

I dont know for what the grid need a route if not for this... :+1:

Example why I need that:

**Controller**
```php
get('grid');
$grid->setSource($source);
$grid->setRouteParameter('company', $item instanceof Company ? $item->getId() : 0);

// Specify route parameters for the edit action
$rowAction2 = new RowAction('Edit', 'route_to_edit');
$rowAction2->setRouteParameters(array('id', 'company.id'));
$rowAction2->setRouteParametersMapping(array('company.id' => 'company'));
$grid->addRowAction($rowAction2);
}
```

The examples throw...

```
An exception has been thrown during the rendering of a template
("Parameter "company" for route "route_for_list" must match "\d+" ("" given) to generate a corresponding URL.")
```

If i use the patch it would work without this:

```php
$rowAction2->setRouteParameters(array('id', 'company.id'));
$rowAction2->setRouteParametersMapping(array('company.id' => 'company'));
```

Then your grid uses the default "id" field for the edit route and the company field for the branches.

**Example usage:**

```php
...
/**
* @Route("/edit/{id}", name="route_to_edit")
* @Template
*/
public function editAction($id)
{
/** @var $company Company */
$company = $this->getRequest()->get('company');

/** @var $branch Branch */
$branch = $this->getDoctrine()->getRepository('AcmeDemoBundle:CompanyBranch')->find($id);
...
}
...
```

**php app/console router:debug**

```
route_for_list ANY ANY ANY /{company}/branch/list
route_to_edit ANY ANY ANY /{company}/branch/edit/{id}
```

Thank's.