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

Putting it all together


Okay, here are a few examples that will help put everything together.

User adds a task

The sequence of events in order to add a task is as follows:

  1. The user visits the site and CodeIgniter routes them to the tasks controller.

  2. The tasks controller loads (by default) the index() function. The index() function checks whether the form validation is false:

    if ($this->form_validation->run() == FALSE) {
    ...
  3. As this is the first load and the form has not been submitted, it will equal false. The index() function then defines the settings for the task_desc text field, calls the get_tasks() function of Tasks_model (which returns all tasks from the database), and then loads the view files, passing the database object to the views/tasks/view.php file.

  4. The user enters the Chase meeting room booking string, selects a date three days into the future, and clicks on Add to submit the form.

  5. The form is submitted and index() validates the task_desc form elements and the three date dropdowns...