I'm currently trying to fix a new form that I assume is being generated in the controller that broke when I updated the version of yiibooster and broke the functionality of their forms. I have inherited this from a developer who is no longer with the company and so I'm trying to make as little changes to the system as possible, as there is little documentation
I decided to just try and revert to CForm but I'm still getting this error
Fatal error: Call to a member function beginWidget() on array in /Applications/XAMPP/xamppfiles/htdocs/framework/web/form/CForm.php on line 437
Note, removing the null from my code returns a stack trace error of "beginwidget function does not exist in sessionForm", which is correct because it no longer is using the extension.
private function getSessionSelectionForm($dataModel) {
// SessionSelection Form Model
$sessionForm = new SessionSelectionForm();
$items = $dataModel->getDynamicFormSessionsConfig($sessionForm);
$form = new CForm (
array(
'title' => 'Session Registration',
'enableClientValidation' => true,
'enableAjaxValidation' => false, // Just keep this to false
'layout' => TbHtml::FORM_LAYOUT_HORIZONTAL,
'elements' => $items,
'buttons' => array(
'reset' => array(
'buttonType' => 'reset',
'label' => 'Reset',
),
'submit' => array(
'buttonType' => 'submit',
'label' => 'Next',
'context' => 'primary'
),
// 'cancel' => array(
// 'type' => 'submit',
// 'label' => 'Cancel',
// 'layoutType' => 'warning'
// ),
),
), null, array(
'htmlOptions' => array('class' => 'well'),
'type' => 'horizontal',
), $sessionForm
);
return $form;
}
And the view
<?php echo $form->render(); ?>
0 comments:
Post a Comment