We're running a project built on top of Zend Framework 1.x, and are considering moving to Symfony 2. We have a domain model mapped with Doctrine 2.
Our (custom built) base controller class extends Zend_Controller_Action to provide a very convenient feature, inspired from Flow3:
Let's say I have this controller:
class UserController extends BaseController
{
public function editAction(User $user)
{
// ...
}
}
If I load this URL:
/user/edit?user=123
The base controller will automatically load the User entity with identity 123, and pass it as a parameter to the editAction() method. If the user parameter is omitted, or if no User with this identity exists, an exception is thrown.
Is there such an implementation for Symfony 2, or is it possible to implement it, and how?