Hello I am trying to link but it s failed with Laravel MVC. What I put <li><a href=" registration.blade.php ">Log in</a></li> On Hello.blade.php. I am trying to click Log in and it said whoops it went something wrong and the url was http://localhost/laravel/ch.1IntegratingFrontEndComponentsWebApp/public/registration
Am I am suppose to put <?php # ?> inside the href? but I got an error from that.
I got mine working two URL's http://localhost/laravel/ch.1IntegratingFrontEndComponentsWebApp/public/register and http://localhost/laravel/ch.1IntegratingFrontEndComponentsWebApp/public/
Here my routes.php. Is there something wrong with it?
Route::get('/', function()
{
return
View::make('hello');
});
It sounds like you probably want something like:
Route::get('register', function(){
View::make('registration');
});
then in your <li> tag, you'd use the href of "/register"
note that your routes file determines what URLs will work in your application Route::get('register'... is telling Laravel to listen for and route traffic to the url http://yourapp.com/register the view::make('registration') part is telling Laravel to use the view file registration.blade.php
Perfect that what I need to know!... thank you, one more question, I have noticed when my <li> use the href of "/register" it does not found object so obviously no file in there which is localhost/register. so I decided to remove the slash "register". What I got URL is http://localhost/laravel/ch.1IntegratingFrontEndComponentsWebApp/public/register. It went through. yaya, so Should I worry about long URL letters? Is nothing wrong with it?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community