
Background Information
I just installed a new copy of CI and modified the hello controller to enable the URL helper so that I can call the base_url method. Then I try to call this method from home.php
Problem: I get the following error message:
Message: Undefined property: Welcome::$load Filename: controllers/welcome.php
The code:
Here's what my welcome controller looks like now:
class Welcome extends CI_Controller { public function __construct() { $this->load->helper('url'); } public function index() { $this->load->view('home'); } }
The view is as follows:
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="X-UA-Compatible" content="IE=Edge"/> <meta charset="utf-8"> <meta name="viewport" content="width = device-width"> <meta name="description" content=""> <title>test site</title> <script> var BASEPATH = "<?php echo base_url(); ?>"; </script> <link href="<?php echo base_url('assets/css/bootstrap.min.css')?>" rel="stylesheet"> <link href="<?php echo base_url('assets/css/navbar.css')?>" rel="stylesheet"> </head>
The system dies in the constructor line of the controller where I try to load the library ...
What i have done so far:
But I still get the error. Any suggestions?
Thanks.
Screenshots:
php codeigniter
dot
source share