sfWidgetFormSelectRadioでULにしないsfWidgetFormSelectRadioをテンプレート内でrender()するとULタグになる。これを止めたい場合、以下のようにformatterを指定する。 class PrivateTeamForm extends BasePrivateTeamForm
{
public function configure() {
$this->widgetSchema['sex'] = new sfWidgetFormSelectRadio(array(
'choices' => array(1 => '男性', 2 => '女性'),
'formatter' => array($this, 'radioFormatterCallback')
));
}
public function radioFormatterCallback($widget, $inputs)
{
$rows = array();
foreach ($inputs as $input) {
$rows[] = $widget->renderContentTag('span', $input['input'] . ' ' . $input['label']);
}
return !$rows ? '' : implode('<br />', $rows);
}
}
参考 |
|