CodeIgniter Forums
Is it possible to have a Pager config file in a module's config directory? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Is it possible to have a Pager config file in a module's config directory? (/showthread.php?tid=75211)



Is it possible to have a Pager config file in a module's config directory? - includebeer - 01-12-2020

I'm working on a blog module for CI4 and I want to customize the pagination links. 

In the doc it says the pager view can be overridden in app/Config/Pager.php, and in module's doc it says you can have a Config directory for your module, but there's not much examples other than how to load a custom config file.

Can I have a Pager config file in my module? Something like my-module/Config/Pager.php? I can't make it work. Maybe I need to override the pager service to load my module's config?


RE: Is it possible to have a Pager config file in a module's config directory? - includebeer - 03-15-2020

I'm back with this problem...

I just reinstalled a new test site with CI 4.0.2 and I'm still stuck with this problem. For my app to use the custom pagination template from my module, I need to edit app/Config/Pager.php because CI won't load my-module/Config/Pager.php.

In the debug toolbar, I can see that only APPPATH/Config/Pager.php is loaded. Is this a bug? Did we forget to check if there's a Pager.php file in a module's config directory?