Welcome Guest, Not a member yet? Register   Sign In
does not automatically redirect for the use of modules.

(This post was last modified: 12-17-2023, 01:51 AM by mywebmanavgat.)

Even if I follow the documentation, the core tries to find it in the default namespaces.

I defined $moduleRoutes in the roiting.php file. but still failed.

[Video: https://www.youtube.com/watch?v=eFxTE1T-UGc]

Try this: https://github.com/kenjis/ci4-modules-te...e51aa45eb1

(12-17-2023, 04:15 AM)kenjis Wrote: Try this: https://github.com/kenjis/ci4-modules-te...e51aa45eb1

I applied the changes but

I keep getting the error No controller is found for: login.

You can download here my empty ci4 Project : https://s6.dosya.tc/server17/lb8trr/ci4.zip.html

PHP Code:
namespace Login\Controllers;
Login extends BaseController
 public function 
 public function 
$data = [];

A controller method that will be executed by Auto Routing (Improved) needs HTTP verb (get, post, put, etc.) prefix like getIndex(), postCreate().

This makes sense but isn't it ridiculous to make it mandatory? Ci3 was really great with everything, but I have to switch to ci4 because I'm not sure if there will be updates for the new php versions.

When I download your project, it works. but when I do it myself step by step, I get an error. anyway, no problem, I will go over it. thank you for your help.

Adding the HTTP method to the controller's method name is mandatory.
Without this, a large number of vulnerabilities would be created that would allow controller filters to be bypassed.

Legacy auto routing can also be used in CI4, but is not recommended.

CI3 does not have controller filters, so they cannot be bypassed, but I am not sure that CI3's auto routing is truly secure.
An attack might be possible if the site is accessed by an HTTP method that the developer does not anticipate.

Theme © iAndrew 2016 - Forum software by © MyBB