News Feed
Sections




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

PHPit.net:
Create your own HTML widgets with PHP
May 28, 2006 @ 17:57:56

PHPit.net has posted yet another fine tutorail today, this time discussing the creation of HTML widgets with the help of PHP.

In this tutorial you'll learn how to create your own HTML widgets, using nothing more than PHP. You'll be shown how to use an output buffer to create your own HTML tags, and then replacing them with dynamic content. The tutorial will finish by showing you how to create a Repeater Control.

They start with an example of using an output buffer callback, a precursor to making your own HTML tags. It grabs the tag from the page, parses it out to perform an action, and spits back out the result. He also implements an HTML parser (one of his own) to correctly parse out the (correctly formatted) HTML into a PHP array. From there, it's just a simple matter of defining your own HTML tags and outputting the custom result inside the handler.

Finally, they get to the Repeater control, a method for displaying the results of the "HTML in PHP" array with all of its custom-tag glory.

1 comment voice your opinion now!
create html custom widget array parse output buffer create html custom widget array parse output buffer


blog comments powered by Disqus

Similar Posts

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 8)

PHPro.org: SPL AppendIterator

SitePoint PHP Blog: How to Expose PHP's Private Parts

SitePoint PHP Blog: Pretty Blue Screen

php[architect]: Sending HTML Emails with Drupal 7, Webform, and Mandrill


Community Events





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


version conference unittest language introduction configure release api opinion laravel list podcast threedevsandamaybe voicesoftheelephpant interview community framework symfony series composer

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