Symfony2 独立表单组件 - 设置表单 [英] Symfony2 standalone form component - setting up a form

查看:28
本文介绍了Symfony2 独立表单组件 - 设置表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 Symfony2 表单构建器组件实现为独立的.文档不过并没有真正谈论这个,只是与使用整个框架有关.

I'm trying to implement Symfony2 form builder component as a standalone. The documentation doesn't really talk about this though, just in relation to using the whole framework.

独立版在 Github 上,但没有文档.

The standalone is on Github but has no docs.

我四处搜索,看到有几个人问这个问题,但似乎没有人有任何答案.

Ive searched around and seen a few people ask this question but none seems to have any answers.

我所需要的只是关于如何设置、构建和查看表单的基本指南.

All I need is a basic guide on how to setup a form , build it, then view it.

有人吗?

推荐答案

编辑:我下面的第一个响应现在已经过时(并且链接不再起作用).请参阅https://github.com/webmozart/standalone-forms 了解最新状态艺术解决方案.

Edit: My first response below is now obsolete (and the link does not work anymore). Please refer to https://github.com/webmozart/standalone-forms for a state-of-the-art solution.

以前的(现已过时的)答案:

我已经努力并设法显示了一个表单(使用 PHP 引擎,而不是 Twig).

I've tried hard and managed to display a form (using PHP engine, not Twig).

确实需要一些组件:Form,还需要 ClassLoaderEventDispatcherTemplating(用于渲染) 和翻译(用于渲染标签).您还需要 FrameworkBundle 包中的一些资源(主要是模板).

Indeed you need a few components: Form, but also ClassLoader, EventDispatcher, Templating (for rendering) and Translation (for rendering labels). You will also need some resources from the FrameworkBundle bundle (mainly templates).

更多信息:http://forum.symfony-project.org/viewtopic.php?f=23&t=36412

还有我的迷你教程:http://n.clavaud.free.fr/blog/index.php?article31/symfony2-standalone-form-component-tutorial

这篇关于Symfony2 独立表单组件 - 设置表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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