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

查看:63
本文介绍了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 ,还需要 ClassLoader EventDispatcher Templating (用于渲染)和翻译(用于呈现标签)。您还将需要 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-组件教程

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

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