Support the ongoing development of Laravel.io →
Configuration
Last updated 2 years ago.
0

Take a look at http://laravel.com/docs/4.2/controllers#implicit-controllers

app/routes.php:

Route::controller('admin', 'AdminController');

app/controllers/AdminController.php:

class AdminController extends Controller {

    public function getIndex()
    {
        echo 'index'
    }

    public function getFoo()
    {
        echo 'foo';
    }

}

Then try to navigate to http://project/admin and http://project/admin/foo.

You'd have to define a line in the routes file for each controller, though.

Last updated 2 years ago.
0

As i understood there is no basic route like in CodeIgniter

Last updated 2 years ago.
0

FreelancerUz said:

As i understood there is no basic route like in CodeIgniter

What do you mean?

Last updated 2 years ago.
0

As you can see you wrote

    Route::controller('admin', 'AdminController');  

In CodeIgniter you don't need to write something to routes.php it just work because CodeIgniter reading URI and trying find the class with that method

Last updated 2 years ago.
0

Yeah. That's one of CodeIgniter's features, automatic routing. But you'll find in most other frameworks that routing is done manually, as is in Laravel.

I'm coming from a CodeIgniter background myself, and all I can say is that you'll get used to it. Having to manually define your routes (especially with filters and groups) gives you much more flexibility and functionality than CI could ever hope to have.

So no, no automatic routing. Unless you'd implement it yourself with a wildcard route.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.