Zend框架2 - 学说2模型形式 [英] Zend Framework 2 - Doctrine 2 Model Forms

查看:139
本文介绍了Zend框架2 - 学说2模型形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



Django 中,您可以根据自己在Doctrine中定义的模型自动创建表单吗?一个基本功能。我发现一些旧的来源,有人试图自己实现...但没有最新或官方的



这些模型表单节省了时间。我问自己为什么人们不会抱怨这个(可能)缺失的功能...

解决方案

Zend 2无法创建形式来自实体本身。原则2甚至不是框架的一部分,或者与Symfony 2相关联。



您可以在实体中使用注释来提示创建所需的所有必要信息为了更深入地了解这个工作原理,我建议你在 Zend 2文档


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...

解决方案

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.

这篇关于Zend框架2 - 学说2模型形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆