【发布时间】:2014-11-21 10:00:43
【问题描述】:
在 _form.php 中,我尝试使用这个简单的代码,但出现错误:
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use app\models\State;
/* @var $this yii\web\View */
/* @var $model app\models\State */
/* @var $form yii\widgets\ActiveForm */
$model = new State();
?>
<?= $this->render('_form', [
'model' => $model,
]) ?>
为什么我会收到此错误。因为相同的代码运行良好。
【问题讨论】: