Book Image

CodeIgniter Web Application Blueprints

Book Image

CodeIgniter Web Application Blueprints

Overview of this book

Table of Contents (16 chapters)
CodeIgniter Web Application Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating the models


There are four models in this project, which are as follows:

  • models/password_model.php: This contains functions that are specific to creating and resetting passwords.

  • models/register_model.php: This contains functions that are specific to registering a user.

  • models/signin_model.php: This contains functions that are specific to signing a user into the system.

  • models/users_model.php: This contains the main bulk of the model functions for this project, specifically CRUD operations to be performed on users and various other admin functions.

So that's an overview of the models for this project; now, let's go and create each model.

Create the /path/to/codeigniter/application/models/password_model.php file and add the following code to it:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Password_model extends CI_Model {
  function __construct() {
      parent::__construct();
  }

The does_code_match() function will check whether the code supplied...