Failed to use think\Route in route file under config
2018-10-26 14:17:58
0
1
896

84C0C8F5EB25F4861E8A70A7244321C3.pngPlease ask the teacher to answer, thank you!

reply all(1)
Peter-Zhu

1.think is the root namespace in ThinkPHP5.1, corresponding to: /thinkphp/libaray/think path;

2. When using the space name in use at the top of the code, the default is from the global Initially, you can omit the global space identifier: \;

3. When used directly in the code, the global space name must be added: \, that is, the fully qualified name;

4.Here It should be written like this: \think\Route::rule(...);

5. However, the framework has preset the facade of the Route class***: \think\facade\Route; So It is recommended to use static *** to access..

  • reply teacher. Mine is the 5.0.5 full version, and I read the instructions for 5.0 as well. use think\Route: Route::rule… It’s accessed like this. Why is it wrong for me to write like this? The 5.0 manual also says that the Route root namespace is think
    author 2018-10-27 11:37:14
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template