[eluser]lucid[/eluser]
Hi everyone
I have a website with.. about 15 pages, but all of them includes the same header and footer (simple include function

.
First, I wanna "remake it" - using this framework and I just want to confront You with my idea - as a total newbie.
I will create one controller, let's call it pages, with method view(), and it goes like that:
Code:
class Pages extends CI_Controller {
public function view($page = 'home') {
$this->load->view('templates/header');
$this->load->view('pages/'.$page);
$this->load->view('templates/footer');
}//view
} //class
than in view/templates i create header.php and footer.php
and in view/pages/ I copy the pages html.
Than I need to change my routes, and mod_rewrite in .htaccess so calling for
domain.com/page3.php will actually call
domain.com/index.php/pages/view/page3 <- I already know how to do it, it's not a problem.
and that's it. Job is done.
---
But.. I want to remake it with help of framework, because I want to create CMS for easy updating some of those pages. So next step would be to make some of those pages using database to download content.
IF I use this structure, would I be able to do it later? Because when i think of it, the only way to make some pages connecting with database would be calling another controller, exacly from first controller, so I would do it like that:
Code:
class Pages extends CI_Controller {
public function view($page = 'home') {
$data=0;
if ($page == "specific1") $data=$this->download("specific1");
$this->load->view('templates/header');
$this->load->view('pages/'.$page, $data);
$this->load->view('templates/footer');
}//view
public function download($which_page) {
// here: connect to database, receive data, return it in array or whatever
} //download
} //class
Is it a good idea ?