简体   繁体   English

什么是laravel 5.2 auth中的auth.authenticate视图

[英]What is auth.authenticate view in laravel 5.2 auth

What is the use of auth.authenticate view, as there is no file under the auth direcirectory named "authenticate", also what is loginView here? auth.authenticate视图的用途是什么,因为auth目录下没有名为“ authenticate”的文件,这里的loginView是什么?

As mentioned in this code: 如该代码中所述:

   public function showLoginForm()
    {
        $view = property_exists($this, 'loginView')
                    ? $this->loginView : 'auth.authenticate';

        if (view()->exists($view)) {
            return view($view);
        }

        return view('auth.signin');
    }

This is the auth trait ( AuthenticatesUsers ), you can overwrite the default view for it. 这是auth特性( AuthenticatesUsers ),您可以覆盖它的默认视图。 You can overwrite more things like: redirect url when the auth is a success, failure url etc. 您可以覆盖更多内容,例如:验证成功时重定向url,失败url等。

So that code can be translated to: 这样该代码可以转换为:

if the property loginView exists then the view loginView will be loaded, else auth.authenticate if auth.authenticate exists then load it else auth.signin 如果属性loginView存在,则将加载视图loginView ,否则auth.authenticate如果auth.authenticate存在,则将其加载,否则auth.signin

Docs 文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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