你好,
我最近接到了一项任务来更新我们的 yiibooster 扩展。
我遇到的问题是这个 tbform 代码在这个版本的 yiibooster 中不再工作(整个 tbform 功能似乎已被删除)
$sessionForm = new SessionSelectionForm();
$items = $dataModel->getDynamicFormSessionsConfig($sessionForm);
$form = TbForm::createForm(
array(
'title' => 'Session Registration',
'enableClientValidation' => true,
'enableAjaxValidation' => false, // Just keep this to false
'layout' => TbHtml::FORM_LAYOUT_HORIZONTAL,
'elements' => $items,
'buttons' => array(
'reset' => array(
'type' => 'reset',
'label' => 'Reset',
),
'submit' => array(
'type' => 'submit',
'label' => 'Next',
'layoutType' => 'primary'
),
// 'cancel' => array(
// 'type' => 'submit',
// 'label' => 'Cancel',
// 'layoutType' => 'warning'
// ),
),
), null, array(
'htmlOptions' => array('class' => 'well'),
'type' => 'horizontal',
), $sessionForm
);
return $form;
我对此重建功能的猜测是,但我没有运气让它真正起作用。(未定义 tbactiveform.0)
$sessionForm = new SessionSelectionForm();
$items = $dataModel->getDynamicFormSessionsConfig($sessionForm);
$form = $this->beginWidget(
'booster.widgets.TbActiveForm',
array(
// 'title' => 'Session Registration',
'enableClientValidation' => true,
'enableAjaxValidation' => false, // Just keep this to false
// 'layout' => TbHtml::FORM_LAYOUT_HORIZONTAL,
'htmlOptions' => array(
'type' => 'horizontal',
'data' => $items,
),
null, $sessionForm
)
); // 'elements' => $items,
$this->widget(
'booster.widgets.TbButtonGroup',
array(
'buttons' => array(
array('label' => 'reset', 'buttonType' => 'reset'),
array('label' => 'next', 'buttonType' => 'submit'),
),
)
);
$this->endWidget();
return $form;