[eluser]andrewtheandroid[/eluser]
Ahh yeh I think I know what you mean. Two options come to mind here.
1. Combine them back into the same one
This way you add the form at the bottom then you can do check if any post values and validation then you still show the news details. Like what you were doing before. But now show the error somewhere (now you are using the string method? so you can now easilly manipulate your final view).
Code:
function readArticle()
{
// if any post validate as usual
// commit entry to database
// generate either success or error message
$data['error'] = ....;
// ----- code below is your original show article()
// get from database/populate article and comments
// ----- show your error message
// ----- show message form
}
2. You can reduce the amount of redundancy to only 2 lines each.
Code:
// 1. you need to make one call to database
$unprocessed_data = $this->model..... etc
// 2. you need to make a call to parse the data using a helper/library/view
$parsed_string = $this->load->view('article_view',$unprocessed_data,true);
OR
$parsed_string = my_helper_parser($unprocessed_data);
So you will have the same code twice but it's not so bad since it's not that redundant.. seeing as if you change the way you parse the article it will carry through with the second.