无法在视图中加载index.php

时间:2019-05-09 04:19:49

标签: php codeigniter

我无法在视图文件夹中加载index.php文件。显示的错误是

  

“无法加载请求的文件:calendar / index.php”

这是代码

  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. 模型(Calendar_model.php):

    *?php
    class Calendar_Model extends CI_Model
    {
    }
    ?>*
    
  3. 视图(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>*
    

1 个答案:

答案 0 :(得分:0)

最好像V_index.php一样重命名index.php

在这种情况下,请从您的代码中删除.php

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

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