美好的一天。当我执行我的CActiveForm的ajax验证时,我有一些PHP错误:
Array to string conversion (/opt/lampp/htdocs/bo/framework/web/helpers/CHtml.php:2181)
*0 /opt/lampp/htdocs/bo/framework/web/helpers/CHtml.php(2181): CWebApplication->handleError()
1 /opt/lampp/htdocs/bo/framework/web/widgets/CActiveForm.php(917): modelName()
2 /opt/lampp/htdocs/bo/protected/controllers/BoinfoController.php(635): validate()
3 unknown(0): BoinfoController->actionCreate()
4 /opt/lampp/htdocs/bo/framework/web/actions/CAction.php(108): ReflectionMethod->invokeArgs()
5 /opt/lampp/htdocs/bo/framework/web/actions/CInlineAction.php(47): CInlineAction->runWithParamsInternal()
6 /opt/lampp/htdocs/bo/framework/web/CController.php(308): CInlineAction->runWithParams()
7 /opt/lampp/htdocs/bo/framework/web/filters/CFilterChain.php(133): BoinfoController->runAction()
8 /opt/lampp/htdocs/bo/framework/web/filters/CFilter.php(40): CFilterChain->run()
9 /opt/lampp/htdocs/bo/framework/web/CController.php(1145): CAccessControlFilter->filter()
10 /opt/lampp/htdocs/bo/framework/web/filters/CInlineFilter.php(58): BoinfoController->filterAccessControl()
11 /opt/lampp/htdocs/bo/framework/web/filters/CFilterChain.php(130): CInlineFilter->filter()
12 /opt/lampp/htdocs/bo/framework/web/CController.php(291): CFilterChain->run()
13 /opt/lampp/htdocs/bo/framework/web/CController.php(265): BoinfoController->runActionWithFilters()
14 /opt/lampp/htdocs/bo/framework/web/CWebApplication.php(282): BoinfoController->run()
15 /opt/lampp/htdocs/bo/framework/web/CWebApplication.php(141): CWebApplication->runController()
16 /opt/lampp/htdocs/bo/framework/base/CApplication.php(180): CWebApplication->processRequest()
17 /opt/lampp/htdocs/bo/index.php(13): CWebApplication->run()*
这里是来自我的控制器的代码:
if (isset($_POST['ajax']) && $_POST['ajax'] === 'boinfo-form') {
echo CActiveForm::validate(array($ico, $loc, $atrrib, $lang, $atext, $Yd, $Yz, $ls, $ch, $go));
Yii::app()->end();
}
以下是来自视图的表格:
$form = $this->beginWidget('CActiveForm', array(
'id' => 'boinfo-form',
'action' =>$create,
'enableAjaxValidation' => true,
'clientOptions' => array(
'validateOnSubmit' => true,
'validateOnChange' => true,
),
'htmlOptions' => array('enctype' => 'multipart/form-data'),
));
?>
你能帮我解决这个问题吗?