Welcome Guest, Not a member yet? Register   Sign In
Title, Description, and Keyword best practice
#6

[eluser]Julio Fagundes[/eluser]
I Agree, but just only showing the logic.

Another way:

Code:
Class MY_Controller extends CI_Controller
{

public $seo;

function __construct()
{
    parent::__construct();
    $this->seo = $this->_get_seo_for_pages(); // Array with (title,desc....)
}

function _get_seo_for_pages()
{

   $seo = array(
             'page_especific' => array(
                                    'title' => 'Title of Site',
                                    'keywords' => 'Keywords',
                                    'description' => 'Something about the site'),
             'default' => array(
                                    'title' => 'Title of Site',
                                    'keywords' => 'Keywords',
                                    'description' => 'Something about the site')
            );


    $page = $this->router->fetch_class();
    return (isset($seo[$page])) ? $seo[$page] : $seo['default'];
}

}


Messages In This Thread
Title, Description, and Keyword best practice - by El Forum - 03-01-2011, 12:56 PM
Title, Description, and Keyword best practice - by El Forum - 03-01-2011, 09:46 PM
Title, Description, and Keyword best practice - by El Forum - 03-01-2011, 11:12 PM
Title, Description, and Keyword best practice - by El Forum - 03-02-2011, 03:47 PM
Title, Description, and Keyword best practice - by El Forum - 03-02-2011, 05:06 PM
Title, Description, and Keyword best practice - by El Forum - 03-02-2011, 05:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB