Without getting hungup on specific names, etc, it sounds like something along the lines of the following might be a good approach. Thoughts?
CodeIgniter3 ...
system/helpers/url_helper.php
Code:
if ( ! function_exists('site_url'))
{
function site_url($uri = '', $protocol = NULL)
{
return get_instance()->config->site_url($uri, $protocol);
}
}
...
application/whatever...
Code:
$this->load->helper('url');
echo site_url();
CodeIgniter4?? ...
system/helpers/URL.php
Code:
namespace CodeIgniter\Helpers\URL;
function siteURL($uri = '', $protocol = NULL)
{
return ...
}
...
application/whatever...
Code:
use CodeIgniter\Helpers\URL;
...
echo URL\siteURL();
James Parry
Project Lead