PHP Classes

HTML Generate: Generate HTML from arrays

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 68%Total: 268 All time: 7,738 This week: 67Up
Version License PHP version Categories
htmlgenerate 1GNU Lesser Genera...5HTML, PHP 5
Description 

Author

This class can generate HTML from arrays.

It can add to a document tags of the supported types with a given list of tag attributes.

The class can set a random tag id, if none is specified. The tag can also be added to a parent tag given by id. The current tag id is returned.

The class can also generate the HTML for the whole document after it is composed.

Picture of Tony Frezza
  Performance   Level  

 

Recommendations

how to convert html to pdf in php using fpdf
how to convert html to pdf in php using fpdf how to convert html

Example

<?php

/**
 * @author Tony Frezza
 * @copyright 2017
 */

   
include('html.php');
   
   
   
$html = new Html;
   
   
$html->add(
        array(
           
'tag' => 'h1',
           
'text' => 'Hello World!'
       
)
    );
   
    echo
$html->getHtml();

?>


Details

# Html Generate ### Installation Include Html class php file as instance a new object: <?php include('html.php'); $html = new Html; ?> ### Usage <?php include('html.php'); $html = new Html; $html->add( array( 'tag' => 'h1', 'text' => 'Hello Word!", ) ); //print html echo $html->getHtml(); ?> ### Author Tony Frezza - [email protected]

  Files folder image Files (7)  
File Role Description
Accessible without login Plain text file example_1_basic_usage Example Example 1 Basic Usage
Accessible without login Plain text file example_2_multiple_nodes_add Example Example 2 Multiple Nodes Add
Accessible without login Plain text file example_3_parent_and_child_nodes Example Example 3 Parent And Child Nodes
Accessible without login Plain text file example_4_adding_child_by_parent_id Example Example 4 Adding Child By Parent id
Accessible without login Plain text file example_5_css_bootstrap Example Example 5 Usage with Css Bootstrap
Plain text file html.php Class The HTML class
Accessible without login Plain text file README.md Doc. README.md

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:268
This week:0
All time:7,738
This week:67Up
 User Ratings  
 
 All time
Utility:100%StarStarStarStarStarStar
Consistency:91%StarStarStarStarStar
Documentation:-
Examples:91%StarStarStarStarStar
Tests:-
Videos:-
Overall:68%StarStarStarStar
Rank:419