CodeIgniter4 Route Attribute |
Hello everyone.
I designed a Library, which make CodeIgniter4 able to define routing settings of controllers through comments. This library is a CodeIgniter4 Router presentative way under the PHP8 Attributes feature, it merely provides litte mapping and encapsulation for some CodeIgniter4 Router methods. By means of scanning the comments automatically inside the Controller, routes and methods will be connected, enables you to write routing rules straightforwardly, and maintain the relationship between Controllers and Routes in a convenient way. Quick demo PHP Code: namespace App\Controllers; Use the definition of #[Route(path: 'attr/route', methods: ["get"])], means the same settings were done in your routing configuration: PHP Code: $routes->get('attr/route', 'App\Controllers\Ci4Controller::hello'); This library will smartly connect your controller and routing automatically, which means you can access to the hello method in Ci4Controller through the path of /attr/route. If you are interested in this library, feel free to visit our Github repository to know how to install and use. Thank you.
You mean like this, already done.
CodeIgniter4 Route Attribute What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
This i already have from
Code: kenjis Codeigniter First, Codeigniter Then You!!
yekrinaDigitals
|
Welcome Guest, Not a member yet? Register Sign In |