Symfony 1.4 - 总是在< table>里面 [英] Symfony 1.4 - are forms always in <table>?

查看:187
本文介绍了Symfony 1.4 - 总是在< table>里面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用sfDoctrineAllowPlugin。我需要具有Twitter的Bootstrap语义的表单。我查看了模板,发现只有 $ form ,它是< table> 。我怎样才能以我的方式进行格式化?我不想使用表,行和列。 大量渲染* 函数可用以显示您表单中的每个项目。




  • renderRow

  • renderLabel

  • 渲染

  • renderError

  • etc ...



但是你也可以为你的表单定义一个装饰器(一个自定义 sfWidgetFormSchemaFormatter )来定义每个项目的显示方式。检查此例子为每个必填字段添加*。

I'm using sfDoctrineAllowPlugin. I need form which has Twitter's Bootstrap semantics. I looked into template and I found, that there is only $form, which is a <table>. How can I format it in my way? I don't want to use table, rows and cols.

解决方案

There are plenty of render* functions available to display each item in your form.

  • renderRow
  • renderLabel
  • render
  • renderError
  • etc ...

But you can also define a decorator (a custom sfWidgetFormSchemaFormatter) for your form to define the way each item will be display. Check this example of adding * for each required field.

这篇关于Symfony 1.4 - 总是在&lt; table&gt;里面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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