how to deal with meta info in each page??

#1
[eluser]123wesweat[/eluser]
hi,

ok i am a bit confused as i am trying to make things as simple as possible and prevent an array ($this->data), like
Code:
if ($this->form_validation->run() == FALSE) {
              $this->data = array(
                //should come from the db
                'metadescription'     => "Your page's description here",
                'metakeywords'          => "keywords, keywords, keywords",
                'page'                  => "register_form"
        );
            $this->load->view('template',$this->data);

also

    function registerTest() {
        $this->load->helper('url');
        $this->load->helper('form');
        $this->data = array(
                //comes from the db
               'metadescription'     => "Your page's description here",
                'metakeywords'     => "keywords, keywords, keywords",
                'pagetitle'        => "Nice title",
                'page'              => "form-test"
        );
        $this->load->view('template',$this->data);
    }


or is there another nice way to have more than one variable replaced?

#2
[eluser]Johan André[/eluser]
You should extend your base controller and add methods like:

set_description($desc)
set_keywords($keywords)
set_title($title)

etc

#3
[eluser]123wesweat[/eluser]
@johan,

sorry still struggling with this. Could you give me some coding example???

kind regards


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme ¬© 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.