extend url_to helper - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11) +--- Thread: extend url_to helper (/showthread.php?tid=90714) |
extend url_to helper - sjender - 04-22-2024 Hi, I would like to extend the url_to() helper function. This is what I did... PHP Code: <?php But I would prefer I didn't have to make a copy of the original function, but refer directly to the CI4 function instead, How can do this? RE: extend url_to helper - datamweb - 04-22-2024 See https://codeigniter4.github.io/CodeIgniter4/general/helpers.html#id12 Or use https://codeigniter4.github.io/CodeIgniter4/extending/common.html RE: extend url_to helper - kenjis - 04-22-2024 (04-22-2024, 07:01 AM)sjender Wrote: But I would prefer I didn't have to make a copy of the original function, but refer directly to the CI4 function instead, You can't. Because we can have only one global function. If you don't need to change the behavior of the uri_to(), I recommend you add a new function like my_url_to(). |