Pregunta

I've looked at so many Stackoverflow questions regarding this and none of them seem to solve my problem. I just want to have a admin folder and controllers within those. Here is what my route looks so far

/*
 * Set the routes. Each route must have a minimum of a name, a URI and a set of
 * defaults for the URI.
 */
Route::set( 'default', '(<controller>(/<action>(/<id>)))' )
->defaults( array(
        'controller' => 'dashboard',
        'action'     => 'index',
    ) );

Route::set('admin','admin(/<controller>(/<action>(/<id>)))')
    ->defaults(array(
        'directory'  => 'admin',
        'controller' => 'dashboard',
        'action'     => 'index',
    ));

No hay solución correcta

Otros consejos

As Kingkero said in his comment, move the route above the default one and it will work. if you read the docs on routing properly (I know it takes a while and a few reads for it all to sink in if you're new to it all, I've been there myself) it should be clear that the default route is a catch-all, and that any specific routes you need should come first, and any catch-all type routes after, as they are tried in sequence and when a match is found no more routes are tried.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top