PHP
  Home arrow PHP arrow Working with CSS Styles and the Stage Pattern 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

Working with CSS Styles and the Stage Pattern in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 4
    2007-04-25


    Table of Contents:
  • Working with CSS Styles and the Stage Pattern in PHP 5
  • Building a target class
  • Defining a basic contextual class
  • Completing the implementation of the stage pattern

  • 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


    Working with CSS Styles and the Stage Pattern in PHP 5
    ( Page 1 of 4 )

    The stage pattern lets you build classes that can modify their behaviors according to the variations of a given programming context. If you want to learn more about it, then you should start reading this article now! Welcome to the final installment of the series that began with "Implementing the stage pattern in PHP 5." Made up of two articles, this series walks you through the application of this useful pattern, and complements the corresponding theory with illustrative code samples.

    Introduction

    Stepping back quickly to the preceding tutorial of the series, you'll recall that I introduced the key concepts of the stage pattern. I also provided you with some friendly hands-on examples, aimed at demonstrating, at least basically, the functionality of this rather unusual pattern.

    Speaking more specifically, in that tutorial I developed a couple of straightforward PHP classes. The first one was tasked with displaying regular DIVs on a simple web page, while the second one was capable of modifying the values assigned to the "overflow" CSS property corresponding to all these DIVs. These classes demonstrated how a particular class can change its behavior in response to the modifications introduced into its context.

    Obviously, the example described above is a concise implementation of the logic followed by the stage pattern, which hopefully will help you understand more easily how it this pattern works. However, to be frank, I think that the more code samples you see covering the pattern in question, the more you'll learn about it. Therefore, in this final article of the series I'm going to provide you with another practical example of how the stage pattern works.

    Essentially, what I plan to demonstrate here is how this pattern can be used to build different versions of a given web document on the fly, either for display on a typical computer monitor, or for printing. There will be a target class, responsible for defining a few CSS styles used by the pertinent web document. There will also be a contextual class to determine which of these styles will be attached to the web page in question.

    Now that you know the purpose of this last tutorial of the series, let's continue learning how to implement the stage pattern with PHP 5. Let's get started now!



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

       

    PHP ARTICLES

    - 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...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...





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