Find us on facebook

Apr 26, 2015

CodeIgniter3 - View folder structure

Commonly used files like header.php, footer.php, menu.php should be placed under views/templates.
Within any other view you can use these files following way.
<?php $this->load->view('templates/top'); ?>
<?php $this->load->view('templates/menu'); ?>

Or In the controller you can use them according to their placement.
$this->load->helper('url');
$this->load->library('AssetLoad');
$this->assetload->queue();
$this->load->view('templates/top');
$this->load->view('templates/menu');
$this->load->view('templates/main');
$this->load->view('templates/footer');

No comments:

Post a Comment