Reputation:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
//error_reporting(0);
$this->load->view('layouts/topmenu.php', $metaData);
//echo $emailid;
//exit;
?>
//I would like to display an HTML file here
<a href=""></a>
<?php $this->load->view('layouts/bottom'); ?>
<?php $this->load->view('layouts/footer'); ?>
I want to display a header and footer page with an html file in between them which is in a .html file.
How do I display the .html file in the PHP code ?
Upvotes: 0
Views: 80
Reputation: 1691
1st, you only send views through your controller. NOT through another view. You should show your controller and what your metadata is
public function Page() {
$this->load->view('layouts/topmenu.php', $metaData);
$this->load->view("file.html");
$this->load->view('layouts/bottom');
$this->load->view('layouts/footer');
}
Upvotes: 0
Reputation: 4033
load same as header footer and use html extention too with file name.
Upvotes: 0
Reputation: 3237
One of the good things of Codeigniter is that this is quite easy to do and has multiple ways to do it
Since it looks like the problem is that the view you need to call is an html file instead of a php file, all you need is to place the html file in your views
directory and load it specifiying the filename extension:
$this->load->view('layouts/file.html');
That's all there is to it really
Upvotes: 3