In this section, we will go through the Controller code and create all of the view files for the front end. Once this is done, we will go through our Model. The first thing that we need to do for our Controller is to create a new file called account.php
in the /system/applications/controller/
directory. Once that is done, we can put the following code into it:
<?php class Account extends Controller { function Account() { parent::Controller(); $this->load->library(array('form_validation', 'session')); $this->load->helper(array('url', 'form')); $this->load->model('account_model'); $this->_salt = "123456789987654321"; } } ?>
As you can see, this is simply our class declaration and our constructor function. Take note of the resources that we are loading. We are loading two libraries: the form_validation
library, and the session
library. We have also loaded two helpers: the url
and form
helpers. Finally, we load a model called...