如何向Jobeet示例添加新表单? [英] How to add a new form to the Jobeet example?
问题描述
我做了 Symfony 1.4 Jobeet示例项目,现在我想添加一个额外的表单。
如何在单个项目中正确执行?默认Symfony本身生成第一个表单,但是如何从头开始创建自己?
如果我在命令行中使用:
php symfony doctrine:build --forms
这只会生成默认表单,我想要有两种表单。我该怎么做?必须生成一个新项目?
不,您不需要创建一个新项目。您可以通过添加额外的表单类来扩展测试项目。只要就像您为第一个表格一样,但是给它您可以通过复制现有的表单文件并重新命名文件名和类名,这样可以通过测试方式来做到这一点。
I did the Symfony 1.4 Jobeet example project and now i would like add an additional form.
How to do it correctly in a single project? Default Symfony itself generates the first form, but how can I create my own from scratch?
If i use in command line:
php symfony doctrine:build --forms
This generates only the default form, I would like to have two forms. How can I do it? Must I generate a new project?
No, you do not need to create a new project. You can extend your test project by adding an additional form class. Just do like you did for your first form, but give it another classname and place it into a file of it's own.
You can do this test-wise by copying over your existing form file and rename both the filename and the classname.
这篇关于如何向Jobeet示例添加新表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!