Symfony,从控制器读取实体字段

I'm trying to make some kind of "reusable" base controller in Symfony 2. Given the name of an entity, is it possible to read the schema of that entity? That is, a list of the entity's fields with the name and the type of each one.

This is in order to automatically generate the inputs in an admin panel and other similar operations.

SensioGeneratorBundle provides CRUD generation capabilities.

Its source code is available on GitHub.
Its documentation is well written; you should probably read it before making your decision.

This bundle can generate a CRUD controller based on a Doctrine entity. Once your application is set up, run the following command:

php app/console generate:doctrine:crud

It will generate forms, controllers and views.
Generated classes are easy to extend.