Welcome Guest, Not a member yet? Register   Sign In
How many lines average do your controllers run ?
#11

[eluser]jdfwarrior[/eluser]
[quote author="internut" date="1236806541"]I did have a "users" controller which had everything you could possibly do to a users record in one controller.

It goes to be over 1,000 lines of code and was just bothering me.

So I split it up to usage like:

Controllers:

add_user.php
edit_user.php
delete_user.php
users_lists.php
users_groups.php
useres_group_exp.php

Having all them in on "users.php" controller just got out of hand. So breaking them up add using
modules for DB calls really broke things up and makes it easier down the road to fix or add things.

And I know there is no "correct" answer to number of lines so forgive me for the initial post wording.

Was just getting a feel for if some actually have controllers that are very large as I was finding it hard to manage. Well not hard just not as easy.[/quote]

Did you use models to do the backend database work? My Controllers tend to be pretty simple for something like that, and most of the coding comes in the Model.
#12

[eluser]internut[/eluser]
models are currently doing the database work with the setup I have.

Wonder if I should have went splitting them up into a bunch of different controllers now.

I mean its not a horrible or bad practice is it?




Theme © iAndrew 2016 - Forum software by © MyBB