Models represent the data logic layer in your framework. Their purpose is to manage raw data and turn it into something that the business logic layer, typically a Controller, can use. A hypothetical interaction could include a request from a Login_Controller to search for all users matching a given username and password. It would be the model's job, in this interaction, to acquire data from the necessary resource, be it a database or other, and to make the decision whether such a user exists. After combing the data resources, the model would then report its findings back to the controller.
Models are loaded using the new keyword. Model class names are suffixed with '_Model'. For instance if you had a 'User_Model' in models/user.php, you would call new User_Model to load this class.
© Copyright 2010 negative11.com