PHP
  Home arrow PHP arrow Enhancing a URL Handling Helper Class in PHP 5
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
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? 
Google.com  
PHP

Enhancing a URL Handling Helper Class in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 3
    2009-08-10


    Table of Contents:
  • Enhancing a URL Handling Helper Class in PHP 5
  • Review: generating dynamic URLs simply
  • Declaring the methods of the URL helper class static
  • Putting the new URL helper class in action

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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


    Enhancing a URL Handling Helper Class in PHP 5
    ( Page 1 of 4 )

    Are you a PHP developer wishing to find an approachable guide that walks you through building different kinds of helper classes in PHP 5? Then look no further, because this group of articles may be the material that you really need.

    Welcome to the fourth part of a series on building helpers in PHP 5. Comprised of eight tutorials, this series shows how to create some of the most common types of helper classes found in many popular PHP frameworks, and it complements the corresponding theoretical concepts with numerous code samples.

    Having already outlined the goal of this set of articles, now it's time to review the topics that were treated in the last one, so you can see how they'll link with the subject of this fourth tutorial. In that specific article I went through the development of a basic URL-handling helper class, whose methods behaved in most cases as simple wrappers for some of the values available in the native $_SERVER superblobal PHP array.

    While it's fair to say that the structure and logic implemented by this helper class was rather rudimentary, it's worth stressing that it demonstrated how to build a URL helper class in PHP 5 in a straightforward fashion.

    Of course, the class in question is susceptible to being enhanced, and that's precisely what I'm going to do in the next few lines. You might be wondering how. Well, as you'll possibly recall, all of the methods of the class were called initially inside the object context, that is dynamically, which may lead to the creation of an unnecessary instance of the helper class.

    So, to solve this issue quickly, in this chapter of the series I'm going to redefine the signature of the previous URL helper class by declaring all of its methods static. Thus the question now is: are you ready to learn the full details of how this will be accomplished? Then don't waste more time; start reading right now!



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

       

    PHP ARTICLES

    - Adding Ordering and Grouping Clauses to the ...
    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...





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