News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Arnold Daniels' Blog:
How I PHP The Output Handler - Continued
December 07, 2007 @ 09:32:00

Continuing on from his previous post on output handling, Arnold Daniels shows how to build on the previous setup and add the ability to include dynamic data into the template.

For instance, it would be nice if the data in the left column, 'Beauty Tips', could be different for each page. There are several ways to solve this, but for know I will choose the simplest.

He takes a few steps to make adding the content simple:

  • Adding markers for the title and left menu to the template
  • Change the OutputHandler class to make it less static
  • use setData() to title the page
  • user setData() to add left column content
  • Use mark() and endmark() to section off a part of the template.

He's provided a demo and made the source code available for download.

1 comment voice your opinion now!
output handler dynamic content title menu output handler dynamic content title menu


blog comments powered by Disqus

Similar Posts

PHP 10.0 Blog: php -T (variable tainting)

PHPMaster.com: Generating Invoices with Zend_Pdf

Arnold Daniels' Blog: How I PHP: The Output Handler - Continued

Frikk.tk: How to make your own CAPTCHA protection using PHP

PHPMaster.com: PHP Security: Cross-Site Scripting Attacks (XSS)


Community Events





Don't see your event here?
Let us know!


tips library opinion introduction laravel release symfony language api package list community interview install deployment bugfix framework podcast series voicesoftheelephpant

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework