codeigniter4 / codeigniter4/CodeIgniter4

AutoRouterImproved extendability

Đang mở
#7,364 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
PHP
Star
6k
Fork
2k
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
73

Mô tả

In the current state, the `AutoRouterImproved` is not thought to be replaced by an App-Specific service and to be extended on.

>[kenjis](https://github.com/codeigniter4/CodeIgniter4/issues/5889#issuecomment-1476185230): Because it is better to implement the interface, not extending the class.

In my case, I need to change the controller & method name which is already implemented in the router.
Re-Implementing the `AutoRouterImproved` to do that seems kinda ridiculous.

Two approaches come to my mind:

1. The specific solution: Use the "parent" routers methods for finding the method and controller name, this prevents duplicate code and allows for a little app-specific behavior.
2. The generic solution: Make the auto routers replaceable by app-specific services
1. Optional: make both extendable, so we don't have to write ridiculous amounts of code for small changes.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.