yii2 视图找不到包

yii2 view can't find the package

我已经在控制器上创建了一个动作:

public function actionReports(){

        return $this->render('reports', []);
    }

我有以下看法'reports':

<?
use frontend\models\ReportsActiveRecord;
use yii\data\ActiveDataProvider;
use yii\grid\GridView;
?>

<div>    


    <?php
    $dataProvider = new ActiveDataProvider([
        'query' => ReportsActiveRecord::find(),
        'pagination' => [
            'pageSize' => 5,
        ],
    ]);
    echo GridView::widget([
        'dataProvider' => $dataProvider,
    ]);    
    ?>
</div>

我在高级应用程序的前端,但收到此错误:

PHP Fatal Error – yii\base\ErrorException Class 'GridView' not found

我不知道为什么或者我在这里遗漏了什么?

谢谢

在你的第一行<? 应该是 <?php