Welcome Guest, Not a member yet? Register   Sign In
Accessing models from custom library
#4

[eluser]jedd[/eluser]
[quote author="stef25" date="1255209727"]
Various things: flatten a multidimensional array,
[/quote]

Doesn't need database access, so that's an easy one.

Quote: ... checking if a user has a certain role,

Possibly needs DB access, but might be better handled by sticking that information into the session at authorisation time. If you're committed to doing DB lookups for this, every time, then do it in a model.


Quote:Basically they are functionalities that were originally in a Client method but could be put in their own function so the original method has less code and so easier to follow. Some of these functions are shared by several Client methods. Alot are custom validation functions.

By Client do you mean Controller?

While I understand the urge to tidy things, relocating blocks of code into other files doesn't seem tidier to my mind - any more than sweeping the floor and leaving the resultant mess in the corner.

Quote:My models contain only queries (no processing) so I'm reluctant to put them there.

Your models can manipulate data to suit what you need back in your controller / view, and still be 'in spec' for MVC.


Messages In This Thread
Accessing models from custom library - by El Forum - 10-10-2009, 07:36 AM
Accessing models from custom library - by El Forum - 10-10-2009, 08:39 AM
Accessing models from custom library - by El Forum - 10-10-2009, 10:22 AM
Accessing models from custom library - by El Forum - 10-10-2009, 06:00 PM
Accessing models from custom library - by El Forum - 10-10-2009, 06:28 PM
Accessing models from custom library - by El Forum - 10-11-2009, 02:37 AM
Accessing models from custom library - by El Forum - 10-11-2009, 06:55 AM
Accessing models from custom library - by El Forum - 10-11-2009, 07:10 AM
Accessing models from custom library - by El Forum - 10-11-2009, 07:27 AM
Accessing models from custom library - by El Forum - 10-11-2009, 07:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB