Welcome Guest, Not a member yet? Register   Sign In
One Controller
#1

[eluser]$ilovephp[/eluser]
Hi everyone, I would like to ask your opinion about having only ONE CONTROLLER for the entire project.

Personally, i found these advantageous since we do not have to load the same libraries on different Controllers. Probably just have different function that will load different views.

Is it feasible?
#2

[eluser]theshiftexchange[/eluser]
Its all about code re-usability and the ease of adjusting sections.

If you are doing a 'big' website with lots of functionality, then one controller would get bloated.

Multiple controllers makes it easier to modify functionality...
#3

[eluser]$ilovephp[/eluser]
thank you for your opinion., i appreciate it
#4

[eluser]Tominator[/eluser]
When you are loading the same libraries, helpers etc. you can just add it to autoloading ...
So I am for: 'More Controllers'
#5

[eluser]$ilovephp[/eluser]
[quote author="Tominator" date="1271687386"]When you are loading the same libraries, helpers etc. you can just add it to autoloading ...
So I am for: 'More Controllers'[/quote]

You have a good point. Thank you.
#6

[eluser]n0xie[/eluser]
Pretty much depends on the situation doesn't it.
#7

[eluser]John_Betong[/eluser]
Initiaily I went down the one controller route until I discovered how to extend controllers with MY_Controller.

Now I have a bloated MY_Controller.php library Sad
 
 
 
#8

[eluser]$ilovephp[/eluser]
thank you for your reply guys! really appreciated it.. now, i think, i have to redesign the structure of my Controller. Smile
#9

[eluser]ranjeet_sangle[/eluser]
If you are working on a single website with a team then its not feasible to keep a single controller because all the members cant work on a single file simultaneously.

So its necessary to divide your project into multiple controllers.

Also according to me website having a single controller gets too bulky..

I think there must be a separate controller for each distinct entity of your website /project...(similar to objects)
#10

[eluser]n0xie[/eluser]
[quote author="ranjeet_sangle" date="1271705959"]If you are working on a single website with a team then its not feasible to keep a single controller because all the members cant work on a single file simultaneously. [/quote]
That's what you use a SCM for.




Theme © iAndrew 2016 - Forum software by © MyBB