HomePHP Building a Sample Application with Method Chaining and CodeIgniter
Building a Sample Application with Method Chaining and CodeIgniter
Definitely, building chainable class methods with PHP 5 is a process that can be mastered with minor effort, even for developers with only an average level of experience in using the object-oriented paradigm. Therefore, if you're a passionate PHP programmer who wishes to learn the key concepts that surround the implementation of method chaining in a painless fashion, then this group of articles is what you need.
Welcome to the final part of a series that covers method chaining in PHP 5. In twelve tutorials, this series attempts to teach you the basics of building chainable class methods with PHP 5 and complements the corresponding theory with copious hands-on examples.
And now that you've come to this point, it's time to summarize the topics that were covered in the last tutorial. In that particular article I finished building a custom model library for the popular CodeIgniter framework, where most (not all) of its functionality relied on the definition and implementation of chainable methods. That speaks for itself about the convenience of using this programming approach.
It's valid to say, though, that this custom library would be pretty useless if I didn't show you how to utilize it in the context of a database-driven application. Therefore, this last installment of the series will be aimed at demonstrating how to build a simple PHP program with CodeIgniter that will perform CRUD operations on a simple MySQL table that will store data on some fictional users.
Now, it's time to stop talking and get our hands dirty building this basic - yet illustrative -- PHP program.