In this book, author David Upton walks you through use of the Code Igniter framework, which is essentially PHP’s answer to Ruby on Rails. I’ve been a avid user of Code Igniter since I discovered it last year, which is a nice waypoint for anyone trying to understand model-view-controller architectures and not wanting to make the move over to ROR quite yet.
The angle of this book is taken from a first time CI developer, but one with some knowledge of both PHP and web development in general. The initial chapters begin by exploring why you’d choose to use CI and some of its benefits over straight PHP code (such as saving on code reproduction or easing development burdens), though doesn’t really offer any real comparison of features of other similar frameworks. A traditional chapter on setup of CI is also included, (though I think at 4 pages could have perhaps been merged with another!).
The book then proceeds by tackling the subject at the core of CI, ‘model-view-controller’ and how this relates to traditional methods of programming. David breaks down how CI is structured very well and gives suggestions of how applications built within it should be designed to be successful. Some of the example code savings at this stage are somewhat minimal over a standard approach, but I think David conveys how these rack up throughout a web app. Useful chapters of how active record and CRUD can be used to ease DB interaction and also how views can be organised to avoid repitition complete with examples should allow any new CI developer to get to grips with it very quickly.
The later chapters quite extensively cover more “geeky” complicated subjects (using objects and namespaces, localisation, getting CI to interact with other services) which might be a bit much for a hobbyist user, but it gives some room for learning for others. The book also includes some good descriptions of how to make the most of the testing and profiling features which CI has out of the box to debug some of the larger web applications that you might undertake (Both features which I’ve previously been unaware of).
The use of friendly language is a welcome change from other texts, but I think in places it does get in the way a bit of the particular functionality which is being talked about. The constant reenforcement of the MVC throughout will be welcome for new converts, but my own practical experience suggests this might be better bent in places. A number of the descriptions of features provided in the book are at the CI site, and I think what might have helped this book is if a single larger running example led the way to describing each of the features.
At the moment, this is the only CI book available and it does well at covering the large featureset CI has. For a seasoned CI veteran it won’t bring any revelations, but if you’re new the framework it will serve you extremely well at getting your head round what makes it shine.
[Disclosure: This book was given freely by PackPub for review within the Cardiff Geeks group.]
Hey, you've reached the personal blog of Ian Wootten. Thanks for stopping by.
dave
February 19th, 2008 at 11:34 pm
How do you think the book would be for a visual basic 6 programmer with virtually no experience of either PHP or of web development?
Ian
February 19th, 2008 at 11:43 pm
I think you’d probably be fine once you’ve got your head around PHP/MySQL. Web development is a whole different ball game to Visual Basic and Visual Basic is a whole different ball game to most other object oriented languages. The book kicks off at a very basic level, but skims over these two languages. What the book doesn’t cover would most likely be found in CI’s own documentation or from PHP/MySQL’s, but I’d suggest finding a suitable text introducing these two languages so you don’t have to hunt down all the most common features from these two sites.