PacktLib: CodeIgniter 1.7 Professional Development

CodeIgniter 1.7 Professional Development

Credits

About the Author

About the Reviewers

Preface

Getting Started with CodeIgniter

Upgrading from older versions of CodeIgniter

Downloading and installing CodeIgniter

Introducing Model View Controller (MVC)

Controllers: The business logic

Models: Data abstraction layer

Views: Your template files

Autoloading resources

Formatting your code—PHP Style Guide

CodeIgniter URLs

CodeIgniter specific files

Summary

Learning the Libraries

What is a library?

What do libraries do?

Benchmarking Class

Input and Security Class

Email Class

File Uploading Class

Image Manipulation Library

Pagination Class

Session Class

Unit testing a class

Summary

Form Validation and Database Interaction

Why should I validate my forms?

Using the Form Validation Library

Saving sets of validation rules to a config file

Using callbacks

Database interaction

Performing simple queries

Returning values

Result helper functions

Active Record

Active Record caching

Method chaining

Manipulating databases with Database Forge

Summary

User Authentication 1

Defining our goals

Creating and connecting to the database

Front end code

Model code

Addressing some issues

The Authentication Library

Summary

User Authentication 2

Using Twitter oAuth

Using Facebook Connect

Summary

Application Security

CodeIgniter's defenses

Strong password policies

Storing passwords securely

Database security

Cross-site scripting (XSS)

Changing the default file structure

Staying up-to-date

Summary

Building a Large-Scale Application

Running benchmarks

Caching

Optimize SQL queries

Avoid disk activity

Run multiple application instances

Summary

Web Services

What is a web service?

Types of web service

RESTful web service

Create a new post

Update a post

Delete a post

Get a blog post

Summary

Extending CodeIgniter

Hooks

Extended controllers

Extended libraries

Custom libraries

Helpers

CodeIgniter's hidden gems

Summary

Developing and Releasing Code to the Community

Find a need in the community (or fill your own need)

Search for existing solutions

Create a plan

Writing the library

Write a user guide

Release options

Handling database tables

Supporting the code

Summary

Index