开发者

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

开发者 https://www.devze.com 2023-03-14 09:41 出处:网络
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

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

精彩评论

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