. Updated Daily. Editions SDA India   SDA Indonesia
BUSINESS ENTERPRISE SOLUTIONS ARCHITECTURE INFORMATION SECURITY WIRELESS & MOBILITY DATA & STORAGE DEVELOPMENT HARDWARE













News

Thursday, 26 April 2007

Article: Working with CSS Styles and the Stage Pattern in PHP 5

 

 

In the final installment of the series that began with 'Implementing the stage pattern in PHP 5,' Alejandro Gervasio shows you 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. Made up of two articles, this series walks you through the application of this pattern, and complements the corresponding theory with illustrative code samples.

In the first tutorial, he 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 could change its behavior in response to the modifications introduced into its context.

In the second part, he defines a target class, responsible for defining a few CSS styles used by the pertinent web document. He also gives an explanation on a contextual class to determine which of these styles will be attached to the web page in question.

He explains the article under the following sections:

  • Building a target class: as the title suggests. he builds a new contextual class with code examples.
  • Defining a basic contextual class: in order to complete the programmatic model imposed by the stage pattern, he builds a contextual class capable of selecting the appropriate CSS style that fits the requirements of a specific web document.
  • Completing the implementation of the stage pattern: in this section, he creates a functional example that demonstrates how a given web document can use different CSS styles according to specific format requirements.

 

Related Reading: Learn to Implement the Stage Pattern in PHP 5

 

Read the Post

 
 
print save email comment

print

save

email

comment

 
 

Search SDA Asia

Free eNewsletter

SDA Asia Magazine Free Download
 
 
 
Copyright @ 2008 SDA Asia Magazine - All Right Reserved Privacy Policy | Terms of Use