yii 报错Invalid argument supplied for foreach() 10
我的控制器里面的写法functionactionAdd(){$jianjie_model=newJianjie();$this->renderPartial('add',...
我的控制器里面的写法
function actionAdd() {
$jianjie_model = new Jianjie();
$this->renderPartial('add', array('jianjie_model' => $jianjie_model));
}
视图
<?php $form = $this->beginWidget('CActiveForm'); ?>
<table border="1" width="100%" class="table_a">
<tr>
<td>
<?php echo $form->labelEx($jianjie_model, 'sz_name') ?>
</td>
<td>
<?php echo $form->textField($jianjie_model, 'sz_name') ?>
</td>
</tr> 展开
function actionAdd() {
$jianjie_model = new Jianjie();
$this->renderPartial('add', array('jianjie_model' => $jianjie_model));
}
视图
<?php $form = $this->beginWidget('CActiveForm'); ?>
<table border="1" width="100%" class="table_a">
<tr>
<td>
<?php echo $form->labelEx($jianjie_model, 'sz_name') ?>
</td>
<td>
<?php echo $form->textField($jianjie_model, 'sz_name') ?>
</td>
</tr> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询