HomePHP Displaying User Comments in a Code Igniter Blog Application
Displaying User Comments in a Code Igniter Blog Application
Welcome to the third part of the six-part series titled “Building a Blogger with the Code Igniter PHP Framework.” In successive tutorials, this series shows you how to use this software package to develop a blog application by using the Model-View-Controller design pattern. In this article, you will learn how to make the application display user comments.
From a programmer’s point of view, building a blog application with PHP can be an extremely educational experience. This process generally requires working with MySQL, as well as creating scripts that must handle several result sets, update and delete database records, and so forth.
Developing such a web application is something that most programmers would love to do, as long as they don’t have to spend a lot of time writing new code. Fortunately, there are several PHP frameworks available on the web that allow users to develop PHP programs with minor hassles. Code Igniter (http://codeigniter.com) is one of the friendliest to use and learn.
So, if you’re interested in learning how to take advantage of the functionality provided by Code Igniter to build a blogger, then this series of articles might be what you’re looking for.
If you had the chance to read the previous article, then you're becoming familiar with building a blogger using Code Igniter. In that tutorial I explained how to combine the functionality of a couple of files to display blog entries previously stored in a MySQL table.
In this specific case, the first of these files was defined as a basic controller, and was provided with the ability to paginate the aforementioned blog entries via the corresponding pagination class included with Code Igniter.
However, in its current incarnation, the blog application is pretty limited. It doesn’t let users post comments on each blog entry. Thus, in the next few lines I’ll be improving the signature of the controller class to address this important issue.
Are you ready to continue learning how to build a blogger with Code Igniter? Then let’s get going!