你可以使用喜欢,
Route::resource('registration', 'RegisterController', array('only' => array('index', 'store', 'show', 'update', 'destroy')));
或者,
Route::resource('registration', 'RegisterController');
然后你可以index
通过GET http://localhost/laravel/registration
like访问,
{{ HTML::link(URL::to('registration'), 'New User?', array('title' => 'Novi korisnik?', 'class' => 'wideBtn', 'id' => 'userRegisterLink')) }}
在此处阅读文档。
控制器的主要功能将是index, store, show, update, destroy
<?php
class RegistrationController extends BaseController {
/**
* Display a listing of the resource.
*
* @return Response
* GET http://localhost/laravel/registration
*/
public function index()
{
return View::make('registrations.index');
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
return View::make('registrations.create');
}
/**
* Store a newly created resource in storage.
*
* @return Response
* POST http://localhost/laravel/registration
*/
public function store()
{
//
}
/**
* Display the specified resource.
*
* @param int $id
* @return Response
* GET http://localhost/laravel/registration/1
*/
public function show($id)
{
return View::make('registrations.show');
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
return View::make('registrations.edit');
}
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
* PUT http://localhost/laravel/registration/1
*/
public function update($id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
* DELETE http://localhost/laravel/registration/1
*/
public function destroy($id)
{
//
}
}