Welcome Guest, Not a member yet? Register   Sign In
I don't know how to work with CI anymore
#1

Hi! I spent a long time on version 4.1.4, and with this new 4.2.10, I unlearned how to work with codeigniter. I learned that there was a change in routing, and even changing "public bool $autoRoutesImproved" to true in Feature.php and enabling "$routes->setAutoRoute(true);" in Routes.php, it is not working as in version 4.1.4 where I could easily access any method of a controller like "/Controller/method/param". In previous versions, I created a method in the installation's default "Home" controller and could access it with "/Home/mymethod" without configuring anything, now even with the changes suggested in Feature.php and Routes.php it's not working.
Reply
#2

(This post was last modified: 12-18-2022, 03:08 AM by kenjis.)

If you want legacy auto routing, set "public bool $autoRoutesImproved" to false,
and "$routes->setAutoRoute(true);".

But remember, the Auto Routing (Legacy) is very dangerous. It is easy to create vulnerable apps
where controller filters or CSRF protection are bypassed.
Reply
#3

(This post was last modified: 12-18-2022, 05:16 PM by kenjis.)

If you want to use Auto Routing (Improved) and you know Auto Routing (Legacy) (=CI3's auto routing) well,
see https://codeigniter4.github.io/CodeIgnit...to-routing
Reply




Theme © iAndrew 2016 - Forum software by © MyBB