1. I'm following CodeHappy: Using Controllers to learn to use laravel controllers, in my PC "myproject/" points to "wamp/www/laravel/public" folder, when I try "myproject/account/login" the browser shows:
Not Found
The requested URL /account/login was not found on this server.
2. Obviously, the browser tries to find the "account" folder instead of using controller, I created the "account" folder under "public" and tried again, my guess was proved right. Should I config anywhere before using controllers?
My code:
application/controllers/account.php
<?php
class Account_Controller extends Base_Controller
{
public function action_index(){
echo "This is the profile page.";
}
public function action_login(){
echo "This is the login form.";
}
public function action_logout(){
echo "This is the logout action.";
}
}
/application/routes.php
Route::get('/', function()
{
return View::make('home.index');
});
Route::controller('account');