Welcome Guest, Not a member yet? Register   Sign In
Opinions on how far to take MVC
#2

[eluser]OES[/eluser]
Example 1 is not really the MVC as you are calling a config value in the view.

Example 2 & 3 Will both work.

Now if you are into SEO then you would know that you should have different page titles for each page. So depending on how many pages you will be loading how about adding your pages to a database and calling them from within the controller to load into your view. You can then add meta descriptions, keywords etc.

A very basic example.

Model
Code:
function select_page($path){
  $this->db->where('path', $path);
  $query = $this->db->get('ci_pages');
  return $query->row_array();
}

Controller
Code:
function services(){
  $data['page'] = $this->my_model->select_page($this->uri->segment(1));
}

View
Code:
<title><?= $page.page_title; ?></title>

This is just food for thought for you.

Good Luck


Messages In This Thread
Opinions on how far to take MVC - by El Forum - 10-30-2008, 07:02 PM
Opinions on how far to take MVC - by El Forum - 10-30-2008, 08:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB