Miscellaneous Code
  Home arrow Miscellaneous Code arrow Validating Input Data with the CodeIgn...
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MISCELLANEOUS CODE

Validating Input Data with the CodeIgniter PHP Framework
By: Alejandros Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2009-09-16

    Table of Contents:
  • Validating Input Data with the CodeIgniter PHP Framework
  • Review: the complete source code of the generic model class
  • Adding validation capabilities to the generic model class
  • Listing the enhanced version of the generic model class

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Validating Input Data with the CodeIgniter PHP Framework


    (Page 1 of 4 )

    Welcome to the sixth installment of the series that shows you how to build a generic model for the CodeIgniter PHP framework. Made up of eight parts, this series walks you through the development of a simple model class for the CodeIgniter PHP framework. This class will allow you to retrieve, save and delete rows of a specified database table with minor hassles by using a truly straightforward programming interface, along with a few basic child models.

    And now that you've been introduced to the main goal of this series of articles, it’s time to review the topics that were covered in the last tutorial, in case you haven’t had the chance to read it yet. In that particular installment I proceeded to implement a new method within the already familiar “AbstractModel” class, called “save().” It came in handy for deleting rows from the model’s associated database table, thus providing the class with the ability to perform basic CRUD operations.

    Also, it’s valid to point out that from an average programmer’s point of view, the model class in its current incarnation should quite decently fill the requirements of most database-driven web applications. However, as I explained in previous articles, it’d be truly useful to give the class the capacity to validate input data before inserting and updating database records, thus avoiding the situation where the corresponding controllers replicate this task at several points of a PHP application.

    Therefore, in the next few lines I’m going to add another method to the “AbstractModel” class, which will be responsible for validating incoming data prior to performing inserts and updates on the specified database table. Want to learn how this method will be coded using the native resources of CodeIgniter? Then  start reading now!

    More Miscellaneous Code Articles
    More By Alejandros Gervasio


       · This chapter of the series shows how to add another method to the model class, handy...
     

    MISCELLANEOUS CODE ARTICLES

    - Building a Model Class for the HMVC Design P...
    - Filtering Input Data and Generating HTML For...
    - The HMVC Design Pattern: Working with MySQL ...
    - Dispatching Requests to MVC Triads with the ...
    - Implementing the Hierarchical Model-View-Con...
    - A Web App Based on a Model for the CodeIgnit...
    - Completing a Model for the CodeIgniter PHP F...
    - Validating Input Data with the CodeIgniter P...
    - Deleting Database Records with the CodeIgnit...
    - Inserting Database Records with a CodeIgnite...
    - Fetching Database Rows with a Model for the ...
    - Model Data and Validation Rules for a Generi...
    - Building a Generic Model for the CodeIgniter...
    - upload image to database sql
    - Random Password Generator





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 12 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek