PacktLib: CodeIgniter for Rapid PHP Application Development

CodeIgniter for Rapid PHP Application Development

Credits

About the Author

About the Reviewers

Preface

Introduction to CodeIgniter

What can CodeIgniter Do for You?

Yes, But…What is CodeIgniter? What are Frameworks?

And Who is That Man?

The 'Open Source' Business Model

What CI Doesn't Do

License

Summary

Two Minutes' Work: Setting up a CodeIgniter Site

Prerequisites

Installing CodeIgniter

Exploring the File Structure

The Configuration File

Does it Work?

Summary

Navigating Your Site

MVC—Just Another Acronym?

The Structure of a CI Site: Controllers and Views

CodeIgniter Syntax Rules

Types of Files or Classes on a CI Site

What are All Those Folders For?

Designing a Better View

Designing a Better Controller

How CI Classes Pass Information and Control to Each Other

Summary

Using CI to Simplify Databases

Configuration Settings

Designing the Database for Our Site

Active Record

Summary

Chapter Appendix: MYSQL Query to Set Up 'websites' Database

Simplifying HTML Pages and Forms

Writing a View

Long and Short PHP Syntax

Nesting Views

Practical Issues of Site Architecture

CI's Form Helper: Entering Data

My 'Display' Model

CI's Validation Class: Checking Data Easily

Summary

Simplifying Sessions and Security

Starting to Design a Practical Site with CI

Moving Around the Site

Security/Sessions: Using Another CI Library Class

Security

Summary

CodeIgniter and Objects

Object-Oriented Programming

Adding Your own Code to the CI 'Super-Object'

Problems with the CI 'Super-Object'

Summary

Using CI to Test Code

Why Test, and What For?

CI's Error Handling Class

CI's Unit Test Class

CI's Benchmarking Class

CI's Profiler Class

Testing with Mock Databases

Control and Timing

Summary

Using CI to Communicate

Using the FTP Class to Test Remote Files

Machines Talking to Machines Again—XML-RPC

Talking to Humans for a Change: the Email Class

Summary

How CI Helps to Provide Dynamic Information

The Date Helper: Converting and Localizing Dates

Working with Text: the Text Helper and Inflector Helper

Going International: the Language Class

Making HTML Tables the Easy Way: the Table Class

Caching Pages

Summary

Using CI to Handle Files and Images

The File Helper

The Download Helper

The File Upload Class

CI's Image Class

Easy File Compression with the CI Zip Class

Summary

Production Versions, Updates, and Big Decisions

Connections: Check the Config Files

Look Out for PHP 4/5 and Operating System Differences

Coping with Change in New CI Versions

So Should I Update If a New CI Version Comes Out?

How to Add On to CI's Basic Classes

Summary

Instant CRUD—or Putting it All Together

The CRUD Model: Design Philosophy

The Standard Controller Format

The Database Tables

The Heart of the Model: the Array

Function by Function: the CRUD Model

Summary

The Verdict on CI

Some Code: the 'do_test' Model

A Balance Sheet

Problems with CI

Summary

Resources and Extensions

CI's User Forums

Video Tutorials

Resources for Other Programmes, e.g. Xampplite, MySQL, PHP

Summary

Index