0

フォーム クラスにカスタム フォーム フィールド要素を追加する方法はありますか?

すなわち

UsersForm クラスの email 要素の直後に span 要素を追加したいと考えています。ここにコードがあります

class UsersForm extends BaseUsersForm
{

   public function configure()
   {
      unset($this['created'], $this['updated']);

      $this->widgetSchema['name'] = new sfWidgetFormInput();
      $this->widgetSchema['email'] = new sfWidgetFormInput();

      <!-- code for the span element here -->

      $this->widgetSchema['password'] = new sfWidgetFormInputPassword();
      $this->widgetSchema['retypepassword'] = new sfWidgetFormInputPassword(array(
        'label' => 'Retype Password'
      ));
   }
 }

電子メールの「フォームフィールド」のすぐ下にスパン要素を追加するためのコード/メソッドは何ですか?

ありがとう

4

1 に答える 1

0

これは醜い方法です。この種のハッキングは避けてください。

$this->widgetSchema['password'] = new sfWidgetFormInputPassword(array('label'=>'<span></span>password'));
于 2011-06-29T16:23:15.997 に答える