[eluser]SPeed_FANat1c[/eluser]
Your idea is good - if you want to add some data that is the same to all views, you simply add it in MY_Controller librarty and all views have that data (for example links on the sidebar are the same everywhere). Before I read your post I did the similar thing:
Code:
//header
$data['title'] = '';
$data['general'] = $this->Views_model->data_for_header();
//most left menu - 0
$data['current_menu'] = 0;
$data['javascript'] = '';
$data['meta'] = array(
0 => '<meta name="Description" content="Information architecture, Web Design, Web Standards." />',
1 => '<meta name="Keywords" content="your, keywords" />',
2 => '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',
3 => '<meta name="Distribution" content="Global" />',
4 => '<meta name="Robots" content="index,follow" />'
);
$this->load->view('header_view',$data);
//main
$data_main = array();
$this->load->view('home_view',$data_main);
//sidear and footer
$data_sidebar['general'] = $this->Views_model->data_for_sidebar();
$this->load->view('sidebar_view',$data_sidebar);
$data_footer['general'] = $this->Views_model->data_for_footer();
$this->load->view('footer_view',$data_footer);
The only thing I hate there is many lines for every page. But with you example it would also be similar, if you want load differrent title, javascript, metadata, other parameters for every page, you have to add many lines.
But yours looks shorter than mine eveen if we add different data, which is good