Welcome Guest, Not a member yet? Register   Sign In
Routing and modules
#7

(This post was last modified: 11-26-2020, 10:00 AM by lucky.)

Yes, I understand, but you have to define them.

If you work on app/controllers the routes work automatically without needing to define them.
If you work on modules/some_module/controllers you have to define the route.

I have tried your solution and does not work. Even the CI guide says the same, that controllers outside the main app folder won't work :/

I think the only solution is create a symlink from app/controllers to each module so
app/controllers/admin -> modules/admin/controllers
app/controllers/portal -> modules/portal/controllers
app/controllers/users -> modules/users/controllers

I don't see other way. 

What you wrote below, is what I want to avoid. The need to define every single route.

PHP Code:
<?php namespace Insitefx\Blog\Config;

/**
 * Insitefx/Name: routes file.
 */

$routes->group('', ['namespace' => 'Insitefx\Blog\Controllers'], function($routes)
{
    $routes->get('blog''Blog::index');
    $routes->get('blog/post/(:num)''Blog::post/$1');
    $routes->post('blog/add''Blog::add');
    $routes->get('blog/category/(:num)''Blog::category/$1');
}); 
Reply


Messages In This Thread
Routing and modules - by lucky - 11-24-2020, 12:33 AM
RE: Routing and modules - by InsiteFX - 11-24-2020, 06:52 PM
RE: Routing and modules - by lucky - 11-25-2020, 12:29 AM
RE: Routing and modules - by InsiteFX - 11-25-2020, 03:46 PM
RE: Routing and modules - by lucky - 11-26-2020, 12:20 AM
RE: Routing and modules - by InsiteFX - 11-26-2020, 03:04 AM
RE: Routing and modules - by lucky - 11-26-2020, 09:57 AM
RE: Routing and modules - by InsiteFX - 11-26-2020, 12:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB