Support the ongoing development of Laravel.io →
Requests Blade Forms
Last updated 2 years ago.
0
Route::get('sportler_edit/{id}', 'SportlerController@editSportler');
Last updated 2 years ago.
0

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?

Last updated 2 years ago.
0

what is the link generated by HTML::link (in your View)

Last updated 2 years ago.
0
@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

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

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?

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

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

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Silvio12 silvio12 Joined 8 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.