![]() |
Fatal error: Call to undefined function: base_url() - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Fatal error: Call to undefined function: base_url() (/showthread.php?tid=8689) |
Fatal error: Call to undefined function: base_url() - El Forum - 05-27-2008 [eluser]floweringmind88[/eluser] When I call base_url() in my view I get a fatal error. I am running php4, would that be the problem? <a href="<?=base_url();?> ">A</a> Chris Fatal error: Call to undefined function: base_url() - El Forum - 05-27-2008 [eluser]Michael Wales[/eluser] base_url() is part of the URL helper. Either load it from within the Controller or load it automatically (my preference based on how much I use the functions contained within) via config/autoload.php Fatal error: Call to undefined function: base_url() - El Forum - 05-27-2008 [eluser]floweringmind88[/eluser] AH thanks soo much! Fatal error: Call to undefined function: base_url() - El Forum - 05-27-2008 [eluser]floweringmind88[/eluser] By the way none of my variables are appearing in my view. Is there another file I need to autoload so I can access my variables in the view? Fatal error: Call to undefined function: base_url() - El Forum - 05-28-2008 [eluser]Maks Baum[/eluser] My sollution to have some base url is just create in eg MY_Controller (from which all my controllers inherit) and in the variable which is a table of varaibles given to output put ['base_url'] so in every view now I just have $base_url And I don't have to load and additional classes (URL helper). This is not a problem becouse I always have to give some variables into view, so one variable doesn't make controllers code less clear. Fatal error: Call to undefined function: base_url() - El Forum - 05-28-2008 [eluser]krwl[/eluser] [quote author="floweringmind88" date="1211924419"]By the way none of my variables are appearing in my view. Is there another file I need to autoload so I can access my variables in the view?[/quote] did you pass the variables when loading view? Code: $vars['one'] = "blabla"; and in the view Code: <?= $one ?> |