1
得到这个错误:收到此错误命名空间声明语句必须在脚本中的第一个声明
Namespace declaration statement has to be the very first statement in the script
在此代码的最开始:
namespace app\controllers;
use yii\web\Controller;
use app\models\users;
class UserController extends Controller
{
public function actionIndex()
{
echo "working on .....";
}
}
Sageth必须具有“before”<?php –
注意,如果文件的文件以UTF8 BOM开头,还可能有这些类型的消息。例如Ultra-Edit UTF8新文件的默认设置...在这种情况下,您必须删除BOM。看看你的编辑器doco。 –
是的,这是我用UTF8保存的UTF8编码问题及其对我的工作。 – Manish