0

This question is so basic, it's kind of embarrassing, but here goes...

This is for Symfony 1.4 - I am trying to modify some auto-generated forms in a Symfony 1.4 app. The problem is, the widgets are rendered too small to display all of the text in the field. For example, in the database table, I have a field of type varchar(50), but the widget only displays 20 characters. I have tried to increase the size in the _form class e.g.

<td colspan="4"> <?php echo $form['email'] ?></td>

but this doesn't appear to have any effect.

Any help is much appreciated.

4

1 に答える 1

1

さまざまな方法でそれを達成できます。

  • テンプレートでクラス/スタイルを関連付けます。

レンダリングにいくつかの属性を与えます。

<?php echo $form->render(array('email' => array('class' => 'email'))) ?>
<?php echo $form['email']->renderRow(array('class' => 'email')) ?>

// Both generate HTML
<input type="text" name="contact[email]" value="" id="contact_email" class="email" />
  • クラス/スタイルをウィジェットに関連付けます。

ウィジェットにいくつかの属性を与えます。

$this->widgetSchema['email'] = new sfWidgetFormInput(array(), array('class' => 'email')); 
于 2012-04-24T14:40:48.090 に答える