iqdavidh's avatar

Routing

Hello... How can I asign a simple route url/controller/action to a controller->action method

My controllers are outside the Http folder

I try the following... but it doesn't work

{

$app->group(['namespace' => 'App\Package\Adm\Controllers'], function ($group) {

    $group->get('/clientesweb/pps/public/adm/inicio/{action}', 'InicioController@{action}');
    $group->get('/clientesweb/pps/public/adm', 'InicioController@index');
  

});

}

0 likes
1 reply
phildawson's avatar

The Classes can be anywhere. The issue is you are directing to a method called {action}.

function {action}()
{
    ...
}

I would try this:

$group->get('/clientesweb/pps/public/adm/inicio/{action}', 'InicioController@show');
function show($action)
{
    return $this->$action();
}

Please or to participate in this conversation.