Free Sample
+ Collection

CodeIgniter 1.7 Professional Development

Adam Griffiths

Become a CodeIgniter expert with professional tools, techniques and extended libraries
RRP $23.99
RRP $39.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849510905
Paperback300 pages

About This Book


  • Learn expert CodeIgniter techniques and move beyond the realms of the User Guide
  • Create mini-applications that teach you a technique and allow you to easily build extras on top of them
  • Create CodeIgniter Libraries to minimize code bloat and allow for easy transitions across multiple projects
  • Utilize third-party APIs (Twitter oAuth and Facebook Connect) and make use of some less-known helper functions – CodeIgniter's hidden gems
  • A step-by-step, practical guide with examples and screenshots

Who This Book Is For

This book is written for advanced PHP developers with a good working knowledge of Object Oriented Programming techniques who are comfortable with developing applications and wish to use CodeIgniter to make their development easier, quicker, and more fun. Basic knowledge of CodeIgniter will be helpful. This book will suit developers who fall into three categories:

  • Professional Developers – employees of a software house or organization with in-house software development
  • Freelance Developers – solo developers working in the industry on their own
  • Just-for-fun Developers – people working with PHP building web applications is their spare time for fun

Table of Contents

Chapter 1: 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
Chapter 2: 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
Chapter 3: 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
Chapter 4: User Authentication 1
Defining our goals
Creating and connecting to the database
Front end code
Model code
Addressing some issues
The Authentication Library
Chapter 5: User Authentication 2
Using Twitter oAuth
Using Facebook Connect
Chapter 6: 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
Chapter 7: Building a Large-Scale Application
Running benchmarks
Optimize SQL queries
Avoid disk activity
Run multiple application instances
Chapter 8: 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
Chapter 9: Extending CodeIgniter
Extended controllers
Extended libraries
Custom libraries
CodeIgniter's hidden gems
Chapter 10: 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

What You Will Learn


  • Learn the Model-View-Controller design pattern to structure your code
  • Create more readable and maintainable queries using the Active Record implementation
  • Create and maintain database tables using the Database Forge class
  • Authenticate users using Twitter oAuth and Facebook Connect
  • Create your own Authentication Library for more control over your user accounts
  • Secure your application using CodeIgniter's built-in functionality and some quick tips to help further
  • Build a RESTful Web Service, opening up your application to third-party developers
  • Create extended Controllers, grouping functionality into multiple Controllers helping to keep repeated code to a minimum
  • Learn techniques used by professionals to scale CodeIgniter over multiple servers
  • Learn top tips for releasing code to the community and giving support to the developers using your code

In Detail

CodeIgniter is an open source PHP framework with a small footprint and exceptional performance. It gives you a rich set of libraries for common tasks, with a simple interface to access them. There are several unexplored aspects of CodeIgniter that can help developers build applications more easily and quickly. In this book, you will learn the intricacies of the framework and explore some of its hidden gems.

If you want to get the most out of CodeIgniter, this book is for you. It teaches you what you need to know to use CodeIgniter on a daily basis. You will create mini-applications that teach a specific technique and let you build on top of the base.

This book will take you through developing applications with CodeIgniter. You will learn how to make your CodeIgniter application more secure than a default installation, how to build large-scale applications and web services, how to release code to the community, and much more. You will be able to authenticate users, validate forms, and also build libraries to complete different tasks and functions.

The book starts off introducing the framework and how to install it on your web server or a local machine. You are introduced to the Model-View-Controller design pattern and how it will affect your development. Some important parts of the CodeIgniter Style Guide are included to keep CodeIgniter development as standardized as possible; this helps greatly when working as part of a team or taking on an old CodeIgniter project. You will quickly move on to how CodeIgniter URLs work and learn about CodeIgniter-specific files such as helpers and plugins. By the time you finish this book, you will be able to create a CodeIgniter application of any size with confidence, ease, and speed.


Read More