ingeniasoftware / luthier-ci

Improved routing, middleware support, authentication tools and more for CodeIgniter 3 framework
https://luthier.ingenia.me/ci/en/
MIT License
150 stars 38 forks source link

Can we have more than one routes ? #12

Closed ericksuryadinata closed 6 years ago

ericksuryadinata commented 6 years ago

let say I have web.php for the website, and admin.php for admin, how can I achieve that?

andersonsalas commented 6 years ago

Hi!

Yes, you can. The Luthier-CI route files are PHP files, so you can include/require another files:

<?php
# application/routes/web.php

Route::get('/', function(){
   luthier_info();
})->name('homepage');

// ( ... )

require __DIR__ . '/admin.php';
<?php
# application/routes/admin.php

Route::group('admin', function(){

    Route::get('/',function(){
        echo 'Hello world';
    });

});

Regarding the integration with Blade, it is an interesting feature and I will investigate how to include it in Luthier-CI.

ericksuryadinata commented 6 years ago

thanks for the reply, So, I still have to include it in web.php? I'll check this out.. About integrating with laravel blade, I made a mistake on routing before (at the prefix name), and I think that was because Luther can't read the blade file, but I totally wrong ! it can read my blade..