简体   繁体   中英

What is \ before name of BaseController in Laravel?

I am new in Laravel, I am watching a video tutorial about Laravel, He made a controller and named that like below:

class AdminAuthController extends \BaseController{
   //Methods and codes goes here
}

What is \\ before BaseController?

它扩展了在全局名称空间中声明的BaseController。

The first Slash at the start of an object name references it's namespace location. Basically it being in the Global namespace in this case.

It looks for the BaseController in global namespace

http://php.net/manual/en/language.namespaces.global.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM