Route::get('sportler_edit/{id}', 'SportlerController@editSportler');
I tried this before but than i get tehe exception
Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException
in
vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php
any idea?
what is the link generated by HTML::link
(in your View)
@extends('layouts.master')
@section('content')
<p>{{HTML::link('sportler_create','Sportler anlegen')}}
@if(isset($sportler))
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>Vorname</th>
<th>Nachname</th>
<th>Aktion</th>
</tr>
</thead>
<tbody>
@foreach($sportler as $s)
<tr>
<td>{{$s->vorname}}</td>
<td>{{$s->nachname}}</td>
<td>{{HTML::link('sportler_edit','bearbeiten',array($s->id))}}</td>
</tr>
@endforeach
</tbody>
</table>
@else
Es sind keine Sportler vorhanden.
@endif
This index file works fine
Hi Silvio12, if I remember well, the third parameter in your HTML::link() method is an array with html tag attributes. You need to pass some attributes as class, id, href, etc.
Then you need to use:
HTML::link('sportler_edit','bearbeiten',array('id' =>$s->id);
Hope it helps you.
Thanks, but
If i write
HTML::link('sportler_edit','bearbeiten',array('id' =>$s->id));
The html link looks like <a id="4" href="http://localhost/laravel-master/public/sportler_edit">bearbeiten</a>
And i get also the throw new NotFoundHttpException;
any other idea?
Your problem is related with your routes, you need to get the URLs related with the APP root in the following URL structure:
http://appName.domain/route
You could create a VirtualHost in your Web Server as follow in your httpd-vhosts.conf file:
#For general Web Server Folder
<VirtualHost localhost:80>
ServerName localhost
DocumentRoot "c:/wamp/www/"
</VirtualHost>
#The new VirtualHost
<VirtualHost yourappname.domain:80>
ServerName yourappname.domain
DocumentRoot "c:/wamp/www/yourappname/public"
</VirtualHost>
Restart your Web Server and run the app in your browser.
Then you obtain a URL as follow:
http://yourappname.domain/sportler_edit/
Hope it helps you.
Now i have replaced the html link with
<td>
{{Form::open(array('url'=>'sportler_edit'))}}
{{Form::hidden('id',$s->id)}}
{{Form::submit('bearbeiten',array('class' =>'btn btn-success'))}}
{{Form::close()}}
</td>
and in my routes.php i have
Route::post('sportler_edit/{id}', 'SportlerController@editSportler');
and i get a NotFoundHttpException in vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php
when i try with this route
Route::post('sportler_edit', 'SportlerController@editSportler');
i get the message Missing argument 1 for SportlerController::editSportler()
I have no idea how to change
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community