Welcome Guest, Not a member yet? Register   Sign In
How to insert view into another view?
#1

Hi!

Sorry for my english.

I just started learning framework, and I have a question:
How to insert view into another view?

In documentation:

PHP Code:
<?php

class Page extends CI_Controller {

 
       public function index()
 
       {
 
               $data['page_title'] = 'Your title';
 
               $this->load->view('header');
 
               $this->load->view('menu');
 
               $this->load->view('content'$data);
 
               $this->load->view('footer');
 
       }




But I wish that there was a basic template, which would connect their content file for each page
Example:
PHP Code:
<?php

class Page extends CI_Controller {

 
      //Basic template (header + empty content + footer)
 
      public $template 'views/main_template';

 
       public function index()
 
       {
 
              //Load only content file for index page
 
       }



How to do it correctly?
Thank you!
Reply


Messages In This Thread
How to insert view into another view? - by Kostia - 12-10-2015, 01:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB