CodeIgniter4 Attribute Routes |
Hi, all.
I started to develop a package that you can set routes in your Controllers with PHP8 Attributes. PHP Code: namespace App\Controllers; This package generates Routes File from the Attribute Routes in your Controllers. So, there is no extra overhead at runtime. See https://github.com/kenjis/ci4-attribute-routes
I've just released v0.1.0.
https://github.com/kenjis/ci4-attribute-routes/releases
@luckmoshy Here is " CodeIgniter4 Attribute Routes", and you problem has nothing to do with it.
Please delete your comment, and create a new topic at https://forum.codeigniter.com/forum-30.html
nice package.
Just tested on my localhost playground. One question: Is it OK what it's generate routes rules two times in RoutesFromAttribute.php file? PHP Code: <?php
Do you mean the file is generated?
The routes are all duplicated. Can you share your controller code, maybe on a GitHub Gist or somewhere that can handle larger pastes?
Created repo - https://github.com/proweb/ci4-with-attributes
Just clone, install dependencies with composer and run PHP Code: php spark route:update and you will see duplicates P.S Just tested with "fresh" codeigniter install and no problem. Don't get why. Very strange.
Remove App namespace in composer.json autoload.psr-4.
Code: --- a/composer.json |
Welcome Guest, Not a member yet? Register Sign In |