A Sneak Peek at my Book
As I told everyone about a week ago, I am currently writing a book about CodeIgniter. And so far, it’s really going quite well.
I’ve decided to post a bit of the preface here, just to give you all a taste for how the book is written and what to expect from it.
Any comments will be greatly appreciated.
Elliot
Preface
As PHP and other server-side languages began to grow in popularity, a new idea within the development world began to emerge: ‘Frameworks’.
Originally, they were a way of having a ‘skeleton’ application to start with when developing a web application. They contained all the basic functions you’d normally write for every web app, like database connectivity and a basic separation of your code.
When most people start developing using PHP or any other server-side programming language, they very rarely think about using a framework if they’ve never used one before. But I believe that a solid framework is integral to building any good web application; hence the reason for writing this book. Frameworks separate your code and put it in ‘logical’ places, in a simple structure. This is a fantastic method of working, because if something goes wrong in your code, it’s much easier to find out where the error occurs if your code is split up into smaller chunks. And, if someone else takes a look at your code, the structure will make ‘sense’ to them too, so your application will benefit from a much easier learning curve.
Soon enough PHP frameworks began to sprout from everywhere, each serving slightly different purposes, but essentially, all doing the same basic job. There are possibly around 30 different PHP frameworks at the time of writing this…
But choosing one isn’t easy. You have to consider which one does the things you need it to, is it flexible enough to change? Can you use it for commercial purposes? Does it scale well? Is the framework well documented? Does it have a wide user base and somewhere to ask questions?
After evaluating all these questions, and searching for the ‘best’ framework, I came upon CodeIgniter, which really does a fantastic job. But you want to know why you should choose CodeIgniter over the vast array of other frameworks out there right?
Why CodeIgniter?
Firstly, I don’t want to pretend that CodeIgniter does ‘everything’ that you might need a framework to do; mainly because everybody has different needs from a framework. But, it does do an awful lot of the things you need straight out of the box, without a huge overhead of a bloated codebase.
CodeIgniter is very ‘light’ – a computing term which basically means that it doesn’t require a huge amount of resources to run. This is great because it cuts down on costs. You don’t need a very powerful webserver to run it.
CI saves you a huge amount of coding time, and it’s licensed fairly to allow use for both personal and commercial use without any worries about licensing fees down the line.
It’s been tried and tested by hundreds of companies around the world and is used by design agencies every day to power their client’s applications.
“Because CodeIgniter ships with many of the same kinds of scripts that are common to any app, it lets you focus on the 20% that’s unique to your project and not worry about the 80% that’s identical to every other dynamic site (database queries, input validation, XSS filtering, etc.) As a result we can provide the same level of high-quality work in a fraction of the time it would take to write it all from scratch. We win and our clients win!”
Nathan D Huening – Onwired.com
There is a huge community behind CodeIgniter, with an excellent User Guide, and a vibrant forum full of clever geeks waiting to answer any questions you might have.
This community is also host to a few great quality CodeIgniter blogs with some fantastic resources and articles. Here’s a few I’d recommend reading:
• Derek Allard (http://www.derekallard.com)
• Michael Wales (http://www.michaelwales.com)
• Elliot Haughin (me) (http://www.haughin.com)
Who is this book for?
This book is aimed at web developers who know most things about XHTML, and a little bit about server-side programming languages preferably PHP.
But, if you’re not too clever in the PHP department, don’t worry!
On this book’s website, there is a great list of tutorials to get you started with PHP and MySQL. As well as this, there are some books I’ve recommended to help you get started with server-side programming languages too.
Once you’ve finished this book, you should know CodeIgniter inside-out, and be able to build rich web applications using this great framework. If you’re just starting out with PHP, then this book will also build your knowledge of the language, and introduce you to good programming practices such as ‘Object Oriented’ and ‘Model-View-Controller’ styles of programming.
If you’re already a seasoned PHP developer, then this book will help you break some of those nasty habits you’ve built over the years, and get some good, modern, clean standards into your code. Also, this book will cover some very advanced topics in the later chapters; these should inspire you as to what CodeIgniter is capable of on a mission-critical enterprise scale.
What’s in this book?
This book consists of 25 chapters varying from the simplest of tasks, to enterprise level CodeIgniter applications. If you are already knowledgeable of PHP and MySQL development, then you can skip to the chapters that are most relevant to you.
Throughout this book there will be snippets of code. All of these can be found on the book’s website (see next section).
Chapter 1 - Installation
CodeIgniter requires a webserver to run. This chapter shows you how to install a webserver which matches all the requirements to run CodeIgniter.
We’ll start by looking at a ‘bundled’ package, containing all of the applications required for your webserver, and then look at installing each of the components individually.


















March 8th, 2008 at 9:20 pm
Hey Elliot,
I just hopped onto the CI bandwagon after years of HARDcoding PHP; I’m using it to build a little AJAH (with jQuery) portfolio site for a photographer. I watched your first screencast and it helped me understand the methodology behind CI much better than the examples on the CI site. You should submit them to EllisLab.
I have a couple questions:
1. Have you heard of or tried Kohana? Seems like CI on steroids and although it’s not fully grown it might be even more useful. What’s your take?
2. How does your modular approach compare with Zacharias Knudsen’s Matchbox (which I’m using for my current project)? It seems as if it does much the same thing without the extra libraries.
Looking forward to the book. I hope it comes out quickly. I have to finish this site by Friday.
March 9th, 2008 at 10:21 am
Looking forward to the book. I hope it touches on some things not included in the other book. Also hope it not geared too much at novice php developers.
March 9th, 2008 at 12:12 pm
Hi Elliot,
Thanks for the hat tip! Looking forward to your book.
Regards,
Nathan H.
OnWired LLC
March 9th, 2008 at 2:27 pm
Elliot, Good luck with the project, even though user guide gives good foundation on the topic, designers like me would like to see more code with real-life apps. Looking forward to the book!!
March 19th, 2008 at 1:57 pm
Exciting news! Get up with me on aim sometime so we can play catch up!
March 22nd, 2008 at 10:11 pm
Waiting for this book. However from which publication , you write this book.
April 2nd, 2008 at 5:32 am
Hi,
When are you planning on releasing this book? Who is your publisher? Will I be able to buy an ebook version of this book?
August 20th, 2008 at 5:58 am
Hi Elliot,
Is any draw back in using the code igniter frame work.