[SOLVED]Route parameter in laravel 4 -
please check routing problem:
route::any('author/(:id)' , array('as'=>'author', 'uses'=>'authorscontroller@view')); and controller:
public function view($id){ homecoming view::make('authors.view') ->with('title','ini halaman penulis berdasarkan urutan abjad') ->with('author', author::find($id)); view.blade.php:
@extends('layouts.default') @section('content') <h1>{{ $author->name }}</h1> <p>{{ $author->bio }}</p> <p>{{ $author->updated_at }}</p> @stop i knew if syntax old laravel , i've searched exact syntax newest laravel, still don't it.
simply alter route to
route::any('author/{id}' , array('as'=>'author', 'uses'=>'authorscontroller@view')); laravel parameters laravel-4 routing
No comments:
Post a Comment