PHP Classes

HTML Generate: Generate HTML from arrays

Recommend this page to a friend!
  Info   View files Example   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 68%Total: 267 This week: 1All time: 7,741 This week: 571Up
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  
Name: Tony Frezza <contact>
Classes: 1 package by
Country: Brazil Brazil
Age: 34
All time rank: 3918316 in Brazil Brazil
Week rank: 420 Up38 in Brazil Brazil Up

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 - frezzatony@gmail.com

  Files folder image Files  
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

 Version Control Unique User Downloads Download Rankings  
 0%
Total:267
This week:1
All time:7,741
This week:571Up
 User Ratings  
 
 All time
Utility:100%StarStarStarStarStarStar
Consistency:91%StarStarStarStarStar
Documentation:-
Examples:91%StarStarStarStarStar
Tests:-
Videos:-
Overall:68%StarStarStarStar
Rank:416