在编辑器notePad++上编辑php文件,总会提醒以下这个错误:
Namespace declaration statement has to be the very first statement in the script
大意是说命名空间的声明必须在脚本的第一行。
可是在检查了自己的代码发现命名空间就是在第一行定义的。
其实错误就在于我们选择的编码格式不正确,可以按如下方式进行解决:
“encoding” -> “Convert to UTF8”,这里要注意为模块的view, controller, model都修改一致的编码格式,细心细心细心