开发者

How to Spread formwidgets in doctrine into multiple columns?

开发者 https://www.devze.com 2023-02-22 11:09 出处:网络
I\'m using symfony1.4 with doctrine. I\'m able to insert/update/delete records using form widgets. But the problem is i have some 75 fields in a single form which i want to spread into two columns.Ple

I'm using symfony1.4 with doctrine. I'm able to insert/update/delete records using form widgets. But the problem is i have some 75 fields in a single form which i want to spread into two columns.Please tell me a way to implem开发者_JAVA百科ent this please.....


This can be done by rendering each one individually on your template or view... For example, if your form has a widget called name, in your template of partial, you can render it by doing:

//this will render the row as the assigned formater does
<?php echo $form['name']->renderRow()?>

or

//in a table
<tr>
  <td>
    <!-- will output only the label -->
    <?php echo $form['name']->renderLabel()?>
  </td>
  <td>
    <!-- will output only the 'input' -->
    <?php echo $form['name']->render()?>
    <!-- will output only the error messages -->
    <?php echo $form['name']->renderError()?>
  </td>
</tr>

If you have any doubt check the Symfony's Forms for Web Designers for more details.

0

精彩评论

暂无评论...
验证码 换一张
取 消