ankit kumar
ankit kumar

Reputation: 11

I am getting error message: "Unable to load the requested file". How to solve the problem?

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

Answers (1)

Alie
Alie

Reputation: 51

In your controller :

$data['main'] = 'layout/demo';
//layout is your directory name

Upvotes: 1

Related Questions