Welcome Guest, Not a member yet? Register   Sign In
unique title, meta keyword, meta description for each page? how to
#4

[eluser]Slowcheetah[/eluser]
For example (quick and dirty);

the Model

Code:
function get_content($id) {
        $this->db->where('id', $id);
        $query = $this->db->get('content', 1);
        if ($query->num_rows() == 1) {
           $row = $query->row();
           return $row->text;
        }
    }

the controller

Code:
function index() {
        $this->load->model('content_model');
        $id = '32';
        $data['page_title'] = $this->content_model->get_content($id);
        $this->load->view('page', $data);
    }

the view

Code:
echo $page_title


Messages In This Thread
unique title, meta keyword, meta description for each page? how to - by El Forum - 06-17-2010, 02:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB