Welcome Guest, Not a member yet? Register   Sign In
Problem with routes if Controller is in a subfolder

Ohhhh ! You found it ! That's the solution ! Thank you so much ! I love you man (or woman) ! ^^
I was getting crazy with that issue and you delivered me !

Hi I have the same issue. Before the subfolder name use a \ of this kind and not /$routes->match(['get','post' Wrote:, 'amp/vamos/(:any).html', 'Amp\Descuento_amp::hola/$1');kilden pid='377340' dateline='1593403441']Hello,

I don't know if it's a good practice, but I wanted to put the controllers for my admin in a subfolder called 'admin' to keep it tidy. So I've changed the namespace like this...
namespace App\Controllers\admin;

... copied the base controller in my admin folder (that's probably the problem)

...And change my routes like this...

$routes->post('/admin/mycontroller', 'admin/Mycontroller::mymethod');

Everything worked well till I wanted to pass arguments...

It works like this :
$routes->match(['get','post'], '/admin/translations/(: segment)', 'Admin_translations::translate/$1');

It doesn't work like this :
$routes->match(['get','post'], '/admin/translations/(: segment)', 'admin/Translations::translate/$1');

What should I do to fix this issue ?
Thank you for any help !

Theme © iAndrew 2016 - Forum software by © MyBB