This question already has an answer here:
- Message: Undefined variable: data 5 answers
I am completly new and have readed the tutorials about codeigniter.
My question is i keep getting this:
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: data
Filename: views/welcome_message.php
Line Number: 70
And my controller "welcome.php":
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
$data = array();
$data['title'] = "Hello world";
$this->load->view('welcome_message', $data);
}
}
My view is
I am using the "$data" in the view-load, but i keep getting this message, why?
</div>