I just started learning PHP. Passing values into views, specifically.
I have the following in my Home.php controller:
<?php
class Home extends CI_Controller{
public function index()
{
$data['title'] = "Passing data to view";
$this->load->view('index', $data);
}
}
?>
And the following in index.php:
<html>
<head>
<title><?php echo $title;?> </title>
</head>
<body>
<h1>This is a heading</h1>
</body>
</html>
However, the title is not updating and still shows the simple text title I had in it earlier.
All files have been saved and the page has been refreshed numerous times.
Can anyone point me in the right direction please?