简体   繁体   English

Laravel 5.1:注册页面路由

[英]Laravel 5.1: Registration page routing

I am developing a registration process using Laravel. 我正在使用Laravel开发注册过程。 But I am feeling a problem. 但我感觉有问题。 I'm using the implicit controller 我正在使用隐式控制器

Route::controllers([
    'auth' => 'Auth\AuthController',
    'password' => 'Auth\PasswordController',
]);

My registration anchor tag link to the 'auth/registration' 我的注册锚标记链接到“身份验证/注册”

<a class="dropdown-toggle" href="auth/register">
    <span class='glyphicon glyphicon-pencil'></span>  Register
</a>

When I first time click the link, It works properly and show my intended page. 当我第一次单击该链接时,它可以正常工作并显示我的预期页面。 But when I go to my intended register page and click again the link it shows an error and also my browser address bar show the link is this way - 但是,当我转到预定的注册页面并再次单击该链接时,它显示了一个错误,并且我的浏览器地址栏也显示了这种链接-

http://localhost:8000/auth/auth/register

And give me an error message - "Controller method not found." 并给我一条错误消息-“找不到控制器方法”。

But when I clicked the link first time the browser address bar showed the link in this way - 但是,当我第一次单击链接时,浏览器地址栏以这种方式显示了该链接-

http://localhost:8000/auth/register

and that's time the link worked properly but when I click it second time on the register page it doesn't work properly and show an error message. 到时候链接可以正常工作了,但是当我第二次在注册页面上单击它时,它不能正常工作并显示错误消息。

Could you please someone let me know how can I fix it? 您能不能让我知道该如何解决?

use url() method 使用url()方法

 <a href="{{ url('/auth/register') }}">register</a> 

instead of href="auth/register" I think it is laravel 5 而不是href =“ auth / register”我认为它是laravel 5

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

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