问题
Is there a way to autocreate forms based on the models I defined within Doctrine?
In Django
its a basic feature. I found some old sources where someone had tried to implement it by himself... but nothing up-to-date or official-looking
These model forms save loads of time. I do ask myself why people don't complain about this (possibly) missing feature...
回答1:
Zend 2 cannot create a form from the Entity itself. Doctrine 2 is not even part of the framework or tied to it as close as to Symfony 2.
You may use annotations in your entity to hint all necessary information for creating a form from it using the annotation builder.
For a deeper understanding how this works I would suggest you to look it up in the Zend 2 Documentation.
来源:https://stackoverflow.com/questions/13953220/zend-framework-2-doctrine-2-model-forms