Welcome Guest, Not a member yet? Register   Sign In
problem with routes in Code Modules
#2

Try this one it works for me, the way you have your group you need to call it like admin/admin

this way you can call it admin and it will go to index method.

PHP Code:
<?php

/**
 * Insitefx/Admin: routes file.
 */

$routes->group('', ['namespace' => 'Insitefx\Admin\Controllers'], function($routes)
{
    $routes->get('admin''Admin::index', ['as' => 'admin']);
    $routes->get('admin/(:any)''Admin::view/$1');

    //$routes->get('dashboard', 'Admin::dashboard', ['as' => 'dashboard']);

}); 

See the group how I left the first field null ''

The bottom one that's remarked out is for the Admin Dashboard which does work using the route->to in html.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
problem with routes in Code Modules - by midav - 03-10-2020, 06:39 AM
RE: problem with routes in Code Modules - by InsiteFX - 03-10-2020, 08:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB