简体   繁体   中英

Can't load index.php in views

I can't load index.php file in view folder. The error displayed is

"Unable to load the requested file: calendar/index.php"

Here is the code

  1. controller(Calendar.php):

      *public function __construct() { Parent::__construct(); $this->load->model("calendar_model"); } public function index() { $this->load->view("calendar/index.php", array()); }* 
  2. model(Calendar_model.php):

     *?php class Calendar_Model extends CI_Model { } ?>* 
  3. view (index.php):

     *<div class="container"> <div class="row"> <div class="col-md-12"> <h1>Calendar</h1> <div id="calendar"> <script type="text/javascript"> $(document).ready(function() { $('#calendar').fullCalendar({ }); }); </script> </div> </div> </div> </div> <script type="text/javascript"> $(document).ready(function() { }); </script>* 

Better rename your index.php like V_index.php

for this case remove .php from your code

public function __construct() 
{
Parent::__construct();
$this->load->model("calendar_model");
}

public function index()
{
$this->load->view("calendar/index", array());
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM