How to override system Helper? It's still calling it. |
I thought this page meant I could copy a helper of the same name from into app/Helpers, and it would use that file instead of the system one? https://codeigniter.com/user_guide/gener...ng-helpers
So I duplicated url_helper.php to app/Helpers, but my CI app is loading both. So how can I disable using the system one in /vendor/codeigniter4/framework/system/Helpers/? My reason is I am trying to load Wordpress functions into my CI app and both use site_url(). So I need CI to not load its own url_helper.php file, and I will duplicate it into app/Helpers and change the site_url() references to ci_site_url(). But the problem is I still receive the error that site_url() is declared in /vendor/codeigniter4/framework/system/Helpers/url_helper.php. PHP Code: Fatal error: Cannot redeclare site_url() (previously declared in /home/myapp/webapps/myapp/vendor/codeigniter4/framework/system/Helpers/url_helper.php:80)
No, this means that all found files will be included. Both in the application directory and in the framework directory.
You cannot disable.
Ok thank you. This was posted as a solution on Stack exchange to the issue I mentioned. So I guess it was not a solution then.
If I include Wordpress files earlier, before CI includes the helpers, I think it works ok. Because CI checks if the function exists first, but WP does not. |
Welcome Guest, Not a member yet? Register Sign In |