开发者

how can I create a span element in form class in symfony 1.4

Is there any way to add custom form-field element in the form class?

i.e.

I want to add a span element just after the email element in the UsersForm class. Here is the code

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'
      ));
   }
 }

What should be the code/method for adding span element exactly below the email 'form-field'?

Thanks


This a ugly way, try to avoid this kind of hack :

$this->widgetSchema['password'] = new sfWidgetFormInputPassword(array('label'=>'<span></span>password'));
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜