Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我制作了一个用于输入电话号码的小部件,从sfWidgetFormInputText. 目标是添加<span>+7<span>.
sfWidgetFormInputText
<span>+7<span>
如何实施?
您的小部件类:
class MyWidgetFormInputPhoneNumber extends sfWidgetFormInputText { public function render($name, $value = null, $attributes = array(), $errors = array()) { return '<span>+7</span> '.parent::render($name, $value, $attributes, $errors); } }