Reputation: 531
I make a widget for entering a phone number, extends from sfWidgetFormInputText
. The goal is to add <span>+7<span>
.
How to implement it?
Upvotes: 0
Views: 124
Reputation: 2333
Your widget class:
class MyWidgetFormInputPhoneNumber extends sfWidgetFormInputText
{
public function render($name, $value = null, $attributes = array(), $errors = array())
{
return '<span>+7</span> '.parent::render($name, $value, $attributes, $errors);
}
}
Upvotes: 1