Okay, here are a few examples that will help put everything together.
The sequence of events taking place when a user subscribes are as follows:
The user visits the application and CodeIgniter routes them to the
signup
controller.The
index()
function in thesignup
controller displays theviews/signup/signup.php
view file.The user views the form in the browser, enters their e-mail address, and submits the form with no validation errors.
The
index()
function packages the users' input into an array called$data
and passes it to theadd()
function ofSignup_model
.The
add()
function performs an Active Record insert to write the users' subscription to thesignups
database table.