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'));
精彩评论