php - code igniter loading a view at the end of the controller -
on ci have possibility load view directly constructor of controller, i'm loading header , footer of page (since it's same each function)
class add extends ci_controller{ public function __construct() { parent::__construct(); $this->load->helper('url'); $this->load->view('header_view'); $this->load->view('footer_view'); } function whatever() { //do stuff } }
but load footer view before loading function, there way without "manually" loading view @ end of each function ?
i add header/footer in main view data, or use template library (i use one).
if in main view function;
// in view html page <?php $this->load->view('header'); ?> <h1>my page</h1> <?php $this->load->view('footer'); ?>
Comments
Post a Comment