如何在codeigniter中包含一个文件

Hy, I have a page on my site, with the name of hotels. here is the code of the hotel page.

here is my controller:

function country_holiday(){
    $data['hotels']= $this->Travel->holiday();
    $this->load->view('hotels', $data);
}

here is my model:

function holiday(){
    $this->db->select();
    $this->db->from('holidays_hotel_2');
    $this->db->order_by('rand()');
    $this->db->limit(16);   
    $query= $this->db->get();                   
    return $query->result_array();
}

I am getting my required data on hotel page and its working fine, I want to include this hotel page into my another page(hotelling program).

I used where i want to placed that hotel in hotelling program page, but it did not show up any detail except the html of hotel page. what should i need to do. Any Idea??

As far as I understood the problem, you want to include your hotel page into hotelling page. Which means you want to call a view inside another view. Yes you can.

In your controller,

function country_holiday(){
    $data['hotels']= $this->Travel->holiday();
    $this->load->view('hotelling', $data);
}

in your view (hotelling.php),

<html>
  <head>
    <title></title>
  </head>
  <body>
     <?php $this->load->view('hotels', $hotels); ?>
  </body>
</html> 

But i'm not sure about the downside of doing this. But it'll work.

I think you want to include a controller into another controller just like a inheritance,so that you can use parent controller functionalities automatically without writing an extra code.So for that you just have to extend your controller with the parent controller and require its path in the child controller and you can use their function using $this.

require('application/controllers/Hotel.php'); /*You have to define the path of the file*/
class Hotelling extends Hotel  /*Then your hotelling controllers extends hotel controller*/
{
    public function index()
    {
        $data = $this->country_holiday();
    }
}