[eluser]Devon Lambert[/eluser]
[quote author="Mareshal" date="1268861473"]Devon, You can't reduce it too much. It's like you would want to buy a brand new car, with $10 and you still want it cheaper[/quote]
Hmmmm, I don't know Mareshal. I mean that must be one beat up car if it only drives in circles. :-)
Don't get me wrong, I love the way the code is flowing thus far, but I can blatantly see myself writing the same lines of code over and over again.
I've already thought around how to reduce the view code, but the controller code is what gets me. Surprised that this one isn't an easier fix is all. Which in now way means I dislike CI. I love CI more than any other framework out there.
Code:
$this->load->model('model_for_this_controller');
function add ('this_controller'){
//reusable code to add my controller's item (i.e. page, site, theme)
$this->model_for_this_controller->add($data);
$this->load->view('success_page');
}
function edit ('this_controller'){
//reusable code to edit my controller's item (i.e. page, site, theme)
$this->model_for_this_controller->edit($data);
$this->load->view('success_page');
}
function delete ('this_controller'){
//reusable code to delete my controller's item (i.e. page, site, theme)
$this->model_for_this_controller->delete($data);
$this->load->view('success_page');
}