Home arrow PHP arrow Using Code Igniter to Enable Comments in a Blog Application

Using Code Igniter to Enable Comments in a Blog Application

Welcome to the fourth episode of the series entitled “Building a Blogger with the Code Igniter PHP framework.” Comprised of seven approachable articles, this series steps you through the development of a blog application using this friendly – yet powerful -- PHP framework. We include copious code samples to demonstrate how to use the MVC pattern to develop a real-world program.

TABLE OF CONTENTS:
  1. Using Code Igniter to Enable Comments in a Blog Application
  2. The application so far
  3. Inserting comments with a Blogger controller class method
  4. Redefining the blogs_comment_view.php file
By: Alejandro Gervasio
Rating: starstarstarstarstar / 4
December 30, 2008

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Introduction

If you have followed the series this far, then you know that the real-world application we're developing is a MySQL-driven blog application. Thanks to the Code Igniter PHP framework, we should be able to develop this application in a relatively short time, without having to spend long hours writing complex classes and functions.

Now that you have been introduced to the main goal of this series, it's time to recapitulate what we covered in the last article. In that particular tutorial, I explained how to build a blog controller class that was charged with displaying on screen a bunch of blog entries, along with their corresponding comments, previously stored on a pair of MySQL tables.

In truth, this last process was performed in a pretty simplistic way, since I recreated a hypothetical scenario in which a few comments were already inserted into one of these MySQL tables. I hope that helped to demonstrate how the controller in question embedded this data into a view file for display purposes.

A decent blog application, however, must provide users with a mechanism that lets them post their comments easily, and the simplest way to do this is via an HTML form. Therefore, in the next few lines, I'll be explaining how to modify the controller class and the comments view file created in the preceding article to incorporate a basic web form that permits users to post comments on a particular blog entry.

Now, it's time to get rid of the preliminaries and see how to improve the functionality of this blog application by letting users to submit their own comments. Let's jump in!



 
 
>>> More PHP Articles          >>> More By Alejandro Gervasio
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: