![]() |
Hi,
i try to run a simple redirection but i failed. Code: redirect('access_denied/index/myval'); it should rout to the controller in my base-folder "access_denied" to the funtion "index" and the values for the index-function with "myval". routes.php Code: $routes->get('access_denied', '\App\Controllers\Access_denied::index'); //no result ->The route for "access_denied/index/myval" cannot be found What i'm doing wrong? Update The Route: $routes->get('accessdenied/(:any)', 'Access_denied::index/$1'); dont work like it should be, i will always redirect to the shield/login page - maybe there is a problem with the settings about the shield-routes? in the Filter Config is this: Code: public array $globals = [ if i comment this line out, the route seems to work. Now i ask myselt how i can change the filter. I want that all pages avivable outside a subfolder in the controllers named "myadminarea" this folder should be only accessable for loggedin users.
take out
Code: \App\Controllers\ and see if it helps, i think underscore is an allowed character although i would have written it camel case accessDenied
Adding access_denied* to the list should work
PHP Code: public array $globals = [
Ok, but is there still a way to change the way it works?
At the moment all pages will "protected" i've not defined in the "except" Array. Much easier for me it will be if i - define a subfolder to protect - with all possible controllernames etc as a kind of wildcard "myfolder/*" - all other pages wont protected and rund only like defined in the routes Update I decide to use the filter function not and add a own function to every page. Now i need a bit help to create a dynamic routes for the logged-in area. I cannot define all possible routes, so i need to create a flexible route how works for all possible url-combinations The idear will be something like that: $routes->get('myfolder/(:alphanum)/(:alphanum)/(:alphanum)/(:alphanum)', '\App\Controllers\Myfolder\$1\$2$\$3\$4'); But this failed, is it possible to do something like that?
In that case, remove the entire session key and go down to the $filters property:
PHP Code: public array $filters = [
Great, but now i've decide to use the filter function not and add a own function to every page.
Now i need a bit help to create a dynamic routes for the logged-in area. I cannot define all possible routes, so i need to create a flexible route how works for all possible url-combinations The idear will be something like that: $routes->get('myfolder/(:alphanum)/(:alphanum)/(:alphanum)/(:alphanum)', '\App\Controllers\Myfolder\$1\$2$\$3\$4'); But this failed, is it possible to do something like that?
After enable the autoroute, my shield login wont work corretly.
For example the routes for "auth/a/handle" etc. runs into a 404-error. May i have to go back to the beginning to create a kind of dynamically route... ...or is it possible to cretae the entries in the route.php dynmically after login by values from database (i have diffrent modules (with diffrent url-syntax) wich users can en/disable, for that i looking for a easy but flexible way)
Do you still have
PHP Code: service('auth')->routes($routes); |
Welcome Guest, Not a member yet? Register Sign In |