【发布时间】:2011-06-22 07:46:19
【问题描述】:
有没有办法在表单类中添加自定义的表单域元素?
即
我想在 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'
));
}
}
在电子邮件“表单域”下方添加 span 元素的代码/方法应该是什么?
谢谢
【问题讨论】:
标签: symfony-1.4 symfony-forms form-fields