PHP Classes

PHP HTML Writer: Compose and output HTML pages programmatically

Recommend this page to a friend!
  Info   View files Example   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 216 All time: 8,303 This week: 488Up
Version License PHP version Categories
html-writer 2.0Freely Distributable5.3HTML, PHP 5
Description 

Author

This class can compose and output HTML pages programmatically.

It can add tags to the composition of a HTML page. The tags may have data and optional attributes. The class can close the last opened tag.

The class can buffer the page tags and return the whole page as a single string when the page composition is concluded.

Picture of Jean-Georges Estiot
  Performance   Level  
Name: Jean-Georges Estiot <contact>
Classes: 2 packages by
Country: Australia Australia
Age: 66
All time rank: 165325 in Australia Australia
Week rank: 259 Up7 in Australia Australia Up

Example

<?php

require_once('class.html.php');

print(
"Example script for the html writer class<br><br>\n\n\n");

html::init();

html::tag('html');

html::tag('head');
html::tag('title','Example page for the HTML writer class');
html::close(); // head

html::tag('body');

html::add_attributes(array('type'=>'text', 'name'=>'text', 'size'=>'30', 'placeholder'=>'Enter your text here'));
html::single_tag('input');

html::close(); // body

html::close();//html

$out = html::get_buffer();

print(
$out);

print(
"\n<br><br>View this document's source to see the generated HTML");

?>


  Files folder image Files  
File Role Description
HTML file class.html.api.html Doc. Methods summary for the html class
HTML file class.html.doc.html Doc. The first part of the class html documentation
Plain text file class.html.php Class The class file
Plain text file combined.js Data Javascript needed for proper viewing of the API docs
Plain text file example.php Example Example file for the html writer
Plain text file style.css Data CSS file needed for viewing the docs

 Version Control Unique User Downloads Download Rankings  
 0%
Total:216
This week:0
All time:8,303
This week:488Up