CodeIgniter Forums
Difficulties accessing the base_url() function - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Difficulties accessing the base_url() function (/showthread.php?tid=73072)



Difficulties accessing the base_url() function - edjon2000 - 03-15-2019

Hello everyone,

It has been a few years since I have posted here.

I have run into an issue with CodeIgniter 3.1.10, I am trying to create a new site, ran into a bit of a hurdle when using other than the default 'welcome' controller, now this could be a rookie problem that I have forgotten about or it could be something with v 3.1.10
this is the error I am getting

Code:
development
An uncaught Exception was encountered
Type: Error

Message: Call to undefined function base_url()

Filename: C:\Apache24\htdocs\ci3blank\application\views\includes\header.php

Line Number: 17

Backtrace:

File: C:\Apache24\htdocs\ci3blank\application\views\includes\template.php
Line: 3
Function: view

File: C:\Apache24\htdocs\ci3blank\application\controllers\Site_controller.php
Line: 20
Function: view

File: C:\Apache24\htdocs\ci3blank\index.php
Line: 349
Function: require_once

What further code would you require from me


RE: Difficulties accessing the base_url() function - vincent78 - 03-15-2019

Hello edjon2000,
Have you loaded the URL helper ?


RE: Difficulties accessing the base_url() function - edjon2000 - 03-15-2019

Dammit, I knew it would be a rookie mistake thank you so much @vincent78 Smile
I used to add a bunch of commonly used helpers, models and libraries to my autoload.php file, I can't believe I forgot that


RE: Difficulties accessing the base_url() function - vincent78 - 03-15-2019

you're welcome Wink