A Single Article

Read it, comment, and share it with your friends

Review: CodeIgniter for Rapid PHP Application Development

Posted October 26 in Reviews.

Packt Publishing asked me to review CodeIgniter for Rapid PHP Application Development and I accepted since I was already interested in learning about CodeIgniter and finding out if it was the right framework for me. I’m glad I took the opportunity because it turns out that I do like CodeIgniter and I plan on using it. Read on for my review.

CodeIgniter for Rapid PHP Application Development by David Upton explains how you can build applications with CodeIgniter and gives some insight into how the framework operates. It covers: setup, MVC concepts, site structure, views and controllers, OOP, database access, built-in classes, the form helper, files, images, sessions, testing, XML-RPC, and CRUD. The order of the topics is a little different than what I would have expected, but it makes sense since it goes from simple tasks like installing and making basic controllers to complex concepts like generate images and making requests to remote servers. Let me share some of the things that I liked and didn’t like about this book.

First, the likes: this book definitely follows the philosophy of ‘loose coupling’ that CodeIgniter was built on. Unlike other MVC frameworks such as Ruby on Rails and CakePHP, CodeIgniter does not insist on always using models. If you just need simple controllers, and you want to put your queries inside your controllers, that’s OK. In CodeIgniter, everything revolves around the controllers. CodeIgniter just helps you build things faster. Its flexibility is probably what I like about it so much.

So, the book starts out like you would expect: the author walks you through installation of the framework and a basic understanding of the MVC pattern, as well as the structure of a typical CodeIgniter web site. This part of the book is very helpful for anyone who has no prior understanding or experience with similar frameworks. It also explains object oriented aspects of CodeIgniter, and even though you should know a little bit about OOP, it covers most of what you need to know. It then talks about database integration and ActiveRecord, which isn’t very useful if you have a lot of SQL experience like myself, but is still an important part of the framework. I’m sure most people will prefer using ActiveRecord, so pay no attention to me there. The book then gets into nested views and helpers, which are two things that you definitely want to take advantage of. It describes the form helper in detail, which is probably the most useful helper in the framework. At least, I don’t know of anyone who likes writing forms by hand. Afterward, the book touches upon some more advanced things like sessions and internationalization, which are useful features that you would want to know about. It also covers testing, which is not something I expect to use, and XML-RPC, which is very useful when you want multiple sites to talk to each other. Finally, the book covers CRUD, which is something everyone talks about when discussing MVC frameworks. The book explains, however, that CRUD is not a feature CodeIgniter promotes. It does not offer scaffolding like other frameworks for a few reasons, one being that for this framework, you never need to go to the command line. While CRUD allows you to make a database interface very easily, it is not good for the production level, which is also why CodeIgniter doesn’t encourage it. Still, this book offers a complete explanation of how to build CRUD with CodeIgniter for those who want it.

I am not someone who usually likes to learn from books, but this one was very helpful. It was not, however, without some faults. One thing I did not like was that, throughout the book, the author is constantly selling CodeIgniter to the reader. This gets in the way of the reading. Plus, I think it should be obvious that if someone is reading the book, they are already sold on the idea of using CodeIgniter. I could have done without all the paragraphs interspersed throughout the text that tell me why I should use the framework. The other problem is that, even though models are not essential, the book doesn’t really talk about them enough. When the book finally does get into a serious MVC example, it’s a bit too complicated to be helpful. The example I’m talking about is the author’s “sample project” that he alludes to throughout the book and finally covers in the last chapter. It’s a sort of testing suite for other web sites, and I really wish he had picked something simpler. I sort of skipped over his examples of the application simply because they were very dense. This gripe is much bigger than the previous two.

Still, even with the faults, this is a very useful book and it’s good to have on hand while working with CodeIgniter for the first time. I’m currently developing an application of my own with the framework, and I definitely think that reading this book was good preparation. If you are looking for a simple framework in PHP that allows you to use as much or as little of MVC as you want, then CodeIgniter is right for you, and this book will help.

Meta

Useful things

Check This

and support what I do

Related Articles

These just might ring a bell

Get a Trackback link

2 Comments

Responses to my article
  1. Michael Whalen October 26, 2007

    Of all the PHP frameworks out there, CodeIgniter is certainly the best. I’ve been playing with it for a little while and it makes the most sense, and the documentation is great.

  2. Daniel Errante October 31, 2007

    When I first began, I liked learning programming languages from books. I could read them away from the computer and it’s usually easier to retain information reading hard copies rather than a computer screen. For someone starting out, I would recommend reading books on PHP object-oriented programming and it’s great that there is a CodeIgniter book out there now.

Leave a comment

Share your thoughts with the world

You can use Markdown, or you can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Please keep comments respectful and on topic.

This form is guarded by Akismet, so don't waste your time trying to submit spam. It won't work. Ever.





Stay on top of new updates at this site: Subscribe to the Feed!