05-15-2008, 07:09 AM
[eluser]jbads[/eluser]
Hi, I've been wondering how other people deal with the layout of their pages. Here is an example of how I've been doing it.
now if someone loads this page and fills in form the form action goes to the registration processing function, now if there is an error with the data they submitted, ie required fields aren't filled in, it redirects to /register page again but post data is obviously cleared and the user must start the form again.
You see my problem?
So how do the rest of you deal with page layout / templates etc.??
Hi, I've been wondering how other people deal with the layout of their pages. Here is an example of how I've been doing it.
Code:
function register(){
// any data that may need to be sent to view
//Set header variables
$page_header['title'] = "Registration";
//load page
$this->load->view('index_header_view', $page_header);
$this->load->view('index_menu_view');
$this->load->view('index_body_view', $data);
$this->load->view('index_sidebar_view');
$this->load->view('index_footer_view');
}
now if someone loads this page and fills in form the form action goes to the registration processing function, now if there is an error with the data they submitted, ie required fields aren't filled in, it redirects to /register page again but post data is obviously cleared and the user must start the form again.
You see my problem?
So how do the rest of you deal with page layout / templates etc.??