Welcome Guest, Not a member yet? Register   Sign In
cleanest way to implement the main layout
#8

[eluser]skunkbad[/eluser]
[quote author="wiredesignz" date="1302864529"]Always use a parent controller and NEVER repeat code if you don't have to. ...[/quote]

I don't agree, because I don't see how one line of code per method would be a catastophe, or would be considered repeating code, such as in OP's example:

Code:
// this is really the only line of code that would be repeated from method to method
$this->load->view('main_layout', $this->data);

If you were talking about not reusing a method, or not reusing a callback function, then I'd agree. Having just inherited a CI site where somebody had wild ideas about the way things should be, I think it is worth considering to create things in simple way that everyone can maintain with little effort. Making things more complex just to get ride of one line of code seems like the wrong decision, but that's just my opinion.


Messages In This Thread
cleanest way to implement the main layout - by El Forum - 04-06-2011, 02:50 PM
cleanest way to implement the main layout - by El Forum - 04-06-2011, 03:47 PM
cleanest way to implement the main layout - by El Forum - 04-06-2011, 05:29 PM
cleanest way to implement the main layout - by El Forum - 04-14-2011, 03:51 PM
cleanest way to implement the main layout - by El Forum - 04-14-2011, 10:35 PM
cleanest way to implement the main layout - by El Forum - 04-14-2011, 11:48 PM
cleanest way to implement the main layout - by El Forum - 04-15-2011, 09:20 AM
cleanest way to implement the main layout - by El Forum - 04-15-2011, 01:15 PM
cleanest way to implement the main layout - by El Forum - 04-15-2011, 05:14 PM
cleanest way to implement the main layout - by El Forum - 04-15-2011, 05:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB