automatically pass $url to views? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: automatically pass $url to views? (/showthread.php?tid=30823) |
automatically pass $url to views? - El Forum - 05-26-2010 [eluser]chr1831[/eluser] How can I automatically pass $this->config->item('base_url'); to every view as $url? I thought about doing an array_merge and storing it in var $data in the class, but then I figured it would be pointless because I would still have to type it in each controller... automatically pass $url to views? - El Forum - 05-26-2010 [eluser]umefarooq[/eluser] use base_url helper function check this user guide will help you http://ellislab.com/codeigniter/user-guide/helpers/url_helper.html automatically pass $url to views? - El Forum - 05-26-2010 [eluser]chr1831[/eluser] *bows before umefarooq* I have been trying to extend the viewer class all day... Some how I missed the top few functions earlier when I went browsing the page. Thanks, Chr1831 |