Fixed Controller inside subfolder path
The problem I am trying to fix is that controllers inside a subfolder inside the controllers path aren't working.
I added an alternative search function for controllers inside the controllers' path set in the configuration for not found controllers.
Hi @chrisasek , thanks for your contribution. I'll check your changes and merge it ASAP.
Thanks.
Alright.
God day @izniburak
I'm still waiting on this.
I'm very busy for this week. Probably I'll check it on weekend. Sorry for the late.
Alright
On Thu, Nov 21, 2024, 11:52 PM İzni Burak Demirtaş @.***> wrote:
I'm very busy for this week. Probably I'll check it on weekend. Sorry for the late.
— Reply to this email directly, view it on GitHub https://github.com/izniburak/php-router/pull/79#issuecomment-2492517930, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2JGIH3RKXZZND6NAHXWQT2BZP2RAVCNFSM6AAAAABRYZJI66VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJSGUYTOOJTGA . You are receiving this because you were mentioned.Message ID: @.***>
Hi @chrisasek , I checked the current version of the package with the controllers in the subfolder, and I have no any error. BTW, when I checked the your public project, I noticed that some of your definitions are wrong. For instance: autoloads, controllers namespace...
If you check the https://github.com/chrisasek/Dicer-mvc/blob/master/composer.json, You can see the autoload definitions are wrong for your project. Also, If you check https://github.com/chrisasek/Dicer-mvc/blob/55233fc8225b7526e85d127a42ceb10da6ada13c/route/web.php#L7, you can see that the TestController namespace is wrong. Because it's under the controllers/test folder. It must ve Controllers\test\TestController.
I tried to create a new project similar with your public project and I configured all thing I mentioned above correctly, and everything seems normal.
Are you sure all definitions and configurations correct?
Please make changes to my public project, I'll use that to check, learn, and fix mine.
Thank you.
I found out that this works.
$router->controller('/food-pools', 'company.FoodPoolController');
However, I can't click on the class to access the class file, so it's not as flexible as this.
$router->controller('/food-pools', CompanyFoodPoolController::class);
My changes help, can you merge please 😌 , I'm having a hard time with the above approach.
Oh, my mistake.
Gotten it. Thanks