卡在权威指南第二章GII [ 新手入门 ]
第一次使用GII,按照教程进行到第二章GII教程,生成crud代码提示我,之前生成的model代码有错误,错误提示是Namespace declaration statement has to be the very first statement in the script(命名空间声明语句必须是脚本中的第一个语 句),我的系统是ubuntu14.04,没有版本问题也没有数据库问题。想问一下这种错误是什么原因,怎么解决。
共 3 条回复
-
打开你之前生成的model文件看看
共 2 条回复我的系统是ubuntu14.04,浏览器没法往系统文件夹下写入文件,所以是复制过来的。代码如下
<?php namespace app\models; use Yii; /** * This is the model class for table "country". * * @property string $code * @property string $name * @property integer $population */ class Country extends \yii\db\ActiveRecord { /** * @inheritdoc */ public static function tableName()
raijin 安徽合肥
注册时间:2016-03-13
最后登录:2022-09-28
在线时长:75小时44分
最后登录:2022-09-28
在线时长:75小时44分
- 粉丝3
- 金钱1880
- 威望0
- 积分2630