Symfony2表单文件夹 [英] Symfony2 Form folder
问题描述
我需要创建一个表单类,我在 http: //symfony.com/doc/current/book/forms.html
我试图在src / Acme / TaskBundle / Form / Type / TaskType.php,但是当我查看我的项目中的文件夹结构时,没有Form文件夹。
我尝试手动创建Form文件夹,在src / Acme / TaskBundle /中,我在Form文件夹和TaskType.php文件(命名空间Acme\TaskBundle\Form\Type Expected:Identifier)。
有没有办法以自动方式创建Form文件夹?或者我该如何手动创建?
-
表单类型的Form \ Type
li>
-
Form \Model
for 表单模型,
-
Form \Handler
对于表单处理程序, - 等。
I need to create a form class,I'm following the symfony book in http://symfony.com/doc/current/book/forms.html
I am trying to create a form in src/Acme/TaskBundle/Form/Type/TaskType.php, but when I look at the folder structure on my project there is no "Form" folder.
I try to create the Form folder manually, in src/Acme/TaskBundle/, I get an error in the the Form Folder and in the TaskType.php files ( namespace Acme\TaskBundle\Form\Type Expected:Identifier).
Is there a way to create the Form folder in an automatic way? Or how can I create in manually?
The Form
folder is just a convention — you can put your forms wherever you want. The convention extends to:
Form\Type
for form types,Form\Model
for form models,Form\Handler
for form handlers,- etc.
这篇关于Symfony2表单文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!