Welcome Guest, Not a member yet? Register   Sign In
Controller code.. your opinion?
#1

[eluser]ok3x[/eluser]
Hello there, i had a disscussion with my friend about code align in controllers. Consider these examples:

A) separate functions

function add_user() {
// code goes gere
}

function edit_user(){
}

function del_user(){
}

B) topic-related function

function user($action){
switch($action) {

case 'add':
// code goes here
break;

case 'edit':
break;

case 'del':
break;
}
}

Which one is the better way how to organize code in controllers and why is that so?
Thx for answers Smile


Messages In This Thread
Controller code.. your opinion? - by El Forum - 10-16-2008, 09:31 AM
Controller code.. your opinion? - by El Forum - 10-16-2008, 09:39 AM
Controller code.. your opinion? - by El Forum - 10-16-2008, 11:39 AM
Controller code.. your opinion? - by El Forum - 10-16-2008, 12:03 PM
Controller code.. your opinion? - by El Forum - 10-16-2008, 02:54 PM
Controller code.. your opinion? - by El Forum - 10-16-2008, 10:15 PM
Controller code.. your opinion? - by El Forum - 10-17-2008, 10:29 AM
Controller code.. your opinion? - by El Forum - 10-17-2008, 03:43 PM
Controller code.. your opinion? - by El Forum - 10-17-2008, 04:24 PM
Controller code.. your opinion? - by El Forum - 10-17-2008, 04:40 PM
Controller code.. your opinion? - by El Forum - 10-17-2008, 04:43 PM
Controller code.. your opinion? - by El Forum - 10-17-2008, 05:50 PM
Controller code.. your opinion? - by El Forum - 10-21-2008, 01:50 AM
Controller code.. your opinion? - by El Forum - 10-21-2008, 03:26 AM
Controller code.. your opinion? - by El Forum - 10-21-2008, 07:42 AM
Controller code.. your opinion? - by El Forum - 10-21-2008, 08:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB