Welcome Guest, Not a member yet? Register   Sign In
Active record minimal length?
#3

[eluser]hmayag[/eluser]
If you need to validate user input before passing it to active record constructs, the appropriate place to do so is in the view and the controller (remember, CI is an implementation of the MVC pattern). I suggest you take a look at the form validation class help. You 'll find lots of example code.

If you are implementing validity checks in your database schema (depending on the application, this may be considered from overkill to absolutely necessary), then you have to provide according functionality db-server-side.

The later case is more a matter of schema design i.e. implementing model functionality in the db engine. If an application needs this level of sophistication and data control, personally I would use the CI model just as an interface (no logic) to pass obtained data to/from the controllers and do all the heavy lifting in the db-engine using stored procedures. This is because I feel more comfortable working with a db engine than because I am aware of any inherent weakness/problem of active record. It is largely a matter of style and preferences.


Messages In This Thread
Active record minimal length? - by El Forum - 07-16-2011, 01:08 PM
Active record minimal length? - by El Forum - 07-16-2011, 09:44 PM
Active record minimal length? - by El Forum - 07-18-2011, 04:25 AM
Active record minimal length? - by El Forum - 07-18-2011, 05:54 AM
Active record minimal length? - by El Forum - 07-18-2011, 08:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB