Reputation: 11
class Home extends CI_controller
{
function index()
{
// $data['title'] = "iezant | index";
$data['main'] = 'demo';
$this->load->view('layout/main_view', $data);
}
Views/layout/main_view.php
<?php
$this->load->view($main);
?>
Views/layout/demo.php
<h1> this is work </h1>
Url : http://localhost/arun/index.php/home/index/
Upvotes: 0
Views: 46
Reputation: 51
In your controller :
$data['main'] = 'layout/demo';
//layout is your directory name
Upvotes: 1