kukko
kukko

Reputation: 653

CodeIgniter where load views

I'm new in using the CodeIgniter and I want to find the view what contain the page's head, because I want to pleace into that my Google Analytics tracking code. I found my base controller, but in the basic controller I found only this:

class Page extends Base_Controller
{

    public function index()
    {
        // Init the Page TagManager

        TagManager_Page::init();
    }

}

Somebody can help me how where can I find that controller and model what loads the view what I want?

Upvotes: 0

Views: 226

Answers (3)

Chitt Ranjan Mahto
Chitt Ranjan Mahto

Reputation: 51

you can load the view using this code..

//$this->load->view('viewPageName'); to load file inside application/views/viewPageName


class Page extends Base_Controller
{

  public function index()
  {
    // Init the Page TagManager

    $this->load->view('viewPageName');
  }

}

Upvotes: 0

Mohammed Ashiq
Mohammed Ashiq

Reputation: 468

Basically what you want is to template your pages. (you need a php which has header,and another which has footer).

You need to follow the userguide by the makers of codeigniter.

http://ellislab.com/codeigniter/user-guide/tutorial/static_pages.html

This above link is how you template it. So in views/templates/header, you can put your analytics.

Upvotes: 1

user2936213
user2936213

Reputation: 1011

View is loaded inside the controller function as:

$this->load->view("yourviewname");

Refer to this link for more details: http://ellislab.com/codeigniter/user-guide/general/views.html

Upvotes: 0

Related Questions