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

(03-10-2020, 08:10 AM)InsiteFX Wrote: 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.
it didn’t help, I see so far the very first version of the framework has many shortcomings. I set everything up according to the documentation and it didn’t help that I dropped it, but if I transfer it to the app / Config / routes.php folder, then my first option and yours work there.
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 midav - 03-10-2020, 08:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB