[eluser]xerosis[/eluser]
I am creating a site which has many pages, each page has its own:
- title
- description
- keyword
Now I have been reading that is is not good practice to call a model from a view.
I have a file called header.php where title, description, and keywords are saved.
What I am currently doing is on each function of each controller I am creating below:
Code:
$seo = array('title' => 'Title of Site', 'keywords' => 'Keywords', 'description' => 'Something about the site');
and when I call the view I call the $seo like:
Code:
$this->load->view('main/main_index', $seo);
Is this the right way to do this? I have a page where I have products and title needs to be dynamic and I don't know what to do there.
Basically if someone can explain to me what is the proper method of doing this, would appreciate it.