Reputation: 6976
I am working with Laravel for a new project, and I am wanting to setup a new URL,
/project/create
I thought this would be as easy as doing the following,
<?php
class Project_Controller extends Base_Controller {
public function action_create()
{
return "Step 1";
}
}
However this returns a 404, can you not just setup an url base on /controller/action is this not the case, will I have to do this,
Route::get('/project/create', function()
{
return View::make('project.index');
});
or similar for every URL/request the site needs?
Upvotes: 1
Views: 760
Reputation: 60040
You can do controller routing.
Option 1:
// Register a specific controller
Route::controller('project');
Option 2 (not recommended in Laravel 3 as known to be buggy sometimes):
// Register all controllers and all routes
Route::controller(Controller::detect());
You can see more options about routing and controller routing here
Upvotes: 1