Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter - Doctrine ORM Tutorial : A way of enhancing CI
#17

[eluser]Burak Guzel[/eluser]
[quote author="wiredesignz" date="1258443459"]Just to be clear, form (input) validation in the controller is not the same thing as data validation in your model.

The controller checks and cleans the incoming data and ensures that each field meets a minimum requirement. It should not try to check if the data values are suitable for use by the application.

ie: A login form with username and password should be form validated only to ensure the fields exist and are minimum length etc. Your business logic in the model should then make the comparisons and verify the actual values submitted and give a result back the controller so it knows how to respond to the user input.[/quote]

Right, I see what you mean.

If you look at the Day4 article, you can see I created another class called Current_User, which encapsulates User.

It's responsible for authenticating the user, and also it contains an instance of the User object once the user is logged in. And it carries it over between page loads, by putting the user_id in the Session.

It's a Singleton pattern class, so it allows for the logged in User instance to be accessed like a global variable: Current_User::user();

Does that sound like what you are talking about?


Messages In This Thread
CodeIgniter - Doctrine ORM Tutorial : A way of enhancing CI - by El Forum - 11-16-2009, 08:03 PM



Theme © iAndrew 2016 - Forum software by © MyBB