PHP Classes

HTML Model Constructor: Generate HTML5 documents 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    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-09 (4 days ago) RSS 2.0 feedNot enough user ratingsTotal: 220 This week: 2All time: 8,254 This week: 220Up
Version License PHP version Categories
model-html 1.0.0Artistic License5HTML, PHP 5
Description 

Author

This class can generate HTML5 documents programmatically.

It provides an extensive list static functions that can take a few parameters and generate HTML open and close tags including some that were introduced in HTML5.

Currently it supports tags for document head and body, paragraphs and character formatting, links, forms, lists, embedding audio and video, JavaScript tags, etc..

Picture of manudg
  Performance   Level  
Name: manudg <contact>
Classes: 6 packages by
Country: Spain Spain

Example

<?php
/*
 * HTML Model Constructor
 * Author: https://github.com/ManuDavila
 * Site: http://jquery-manual.blogspot.com
 */
require "ModelHtml/ModelHtml.php";

echo
HTML::add("<!DOCTYPE HTML>\n");
echo
HTML::open_html();
echo
HTML::open_head();
/* Add slash alternative:
 echo HTML::meta("title", "HTML Model Constructor", "/");
 RESULT: <meta name='title' content='HTML Model Constructor'/>
 */
echo HTML::favicon("images/php.ico");
echo
HTML::charset("UTF-8");
echo
HTML::title("HTML Model Constructor");
echo
HTML::meta("viewport", "width=device-width");
echo
HTML::meta("title", "HTML Model Constructor");
echo
HTML::meta("description", "This class can generate HTML5 documents programmatically.");
echo
HTML::meta("keywords", "html, html5, form, php, model, class");
echo
HTML::meta("robots", "All");
echo
HTML::script("http://code.jquery.com/jquery-1.11.1.min.js");
echo
HTML::link_style("css/index.css");

echo
HTML::open_script();
//Your Javascript code here
echo HTML::close_script();

echo
HTML::open_style();
//Your CSS code here
echo HTML::close_style();

echo
HTML::close_head();

echo
HTML::open_body();

echo
HTML::open_header();
echo
HTML::open_div(array("class" => "container"));
echo
HTML::h1("HTML Model Constructor", array("class" => "title"));
echo
HTML::p("This class can generate HTML5 documents programmatically.
It provides an extensive list static functions that can take a few parameters and generate HTML open and close tags including some that were introduced in HTML5.
Currently it supports tags for document head and body, paragraphs and character formatting, links, forms, lists, embedding audio and video, JavaScript tags, etc.."
);
echo
HTML::close_div();
echo
HTML::close_header();

echo
HTML::open_main();
echo
HTML::open_div(array("class" => "container"));
echo
HTML::h3("Methods from HTML class:");
echo
HTML::open_ul(array("id" => "list"));
foreach (
get_class_methods('HTML') as $val)
{
   echo
HTML::add_li($val);
}
echo
HTML::close_ul();
echo
HTML::close_div();
echo
HTML::close_main();

echo
HTML::open_footer();
echo
HTML::open_div(array("class" => "container"));
echo
HTML::open_center();
echo
HTML::small("Author: " . HTML::a("https://github.com/ManuDavila", "ManuDavila", array("target" => "_blank")));
echo
HTML::close_center();
echo
HTML::close_div();
echo
HTML::close_footer();

echo
HTML::close_body();
echo
HTML::close_html();


Details

<header> <div class='container'> <h1 class='title'>HTML Model Constructor</h1> <p>This class can generate HTML5 documents programmatically. It provides an extensive list static functions that can take a few parameters and generate HTML open and close tags including some that were introduced in HTML5. Currently it supports tags for document head and body, paragraphs and character formatting, links, forms, lists, embedding audio and video, JavaScript tags, etc..</p> </div> </header> <main> <div class='container'> <h3>Methods from HTML class:</h3> <ul id='list'> <li>add</li> <li>add_audio</li> <li>add_li</li> <li>add_option</li> <li>add_row</li> <li>addslashes</li> <li>add_video</li> <li>b</li> <li>blockquote</li> <li>br</li> <li>button</li> <li>charset</li> <li>checkbox</li> <li>cite</li> <li>close_address</li> <li>close_article</li> <li>close_aside</li> <li>close_audio</li> <li>close_body</li> <li>close_canvas</li> <li>close_center</li> <li>close_details</li> <li>close_div</li> <li>close_figure</li> <li>close_footer</li> <li>close_form</li> <li>close_head</li> <li>close_header</li> <li>close_html</li> <li>close_main</li> <li>close_nav</li> <li>close_section</li> <li>close_script</li> <li>close_select</li> <li>close_style</li> <li>close_table</li> <li>close_ul</li> <li>close_video</li> <li>color</li> <li>date</li> <li>datetime</li> <li>datetime_local</li> <li>dialog</li> <li>entities</li> <li>entities_decode</li> <li>div</li> <li>email</li> <li>favicon</li> <li>figcaption</li> <li>file</li> <li>h1</li> <li>h2</li> <li>h3</li> <li>h4</li> <li>h5</li> <li>h6</li> <li>hidden</li> <li>hr</li> <li>iframe</li> <li>image</li> <li>input</li> <li>i</li> <li>label</li> <li>a</li> <li>link_style</li> <li>mark</li> <li>meta</li> <li>month</li> <li>number</li> <li>object</li> <li>open_address</li> <li>open_article</li> <li>open_aside</li> <li>open_audio</li> <li>open_body</li> <li>open_canvas</li> <li>open_center</li> <li>open_details</li> <li>open_div</li> <li>open_figure</li> <li>open_footer</li> <li>open_form</li> <li>open_head</li> <li>open_header</li> <li>open_html</li> <li>open_main</li> <li>open_nav</li> <li>open_section</li> <li>open_script</li> <li>open_select</li> <li>open_style</li> <li>open_table</li> <li>open_ul</li> <li>open_video</li> <li>p</li> <li>password</li> <li>pre</li> <li>progress</li> <li>radio</li> <li>range</li> <li>script</li> <li>search</li> <li>small</li> <li>span</li> <li>specialchars</li> <li>specialchars_decode</li> <li>strong</li> <li>submit</li> <li>summary</li> <li>tel</li> <li>text</li> <li>textarea</li> <li>title</li> <li>time</li> <li>token</li> <li>url</li> <li>url_encode</li> <li>url_dedoce</li> <li>week</li> </ul> </div> </main> <footer> <div class='container'> <center> <small>Author: <a href='https://github.com/ManuDavila' target='_blank'>ManuDavila</a> </small> </center> </div> </footer>


  Files folder image Files  
File Role Description
Files folder imagecss (1 file)
Files folder imageimages (1 file)
Files folder imageModelHtml (1 file)
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file LICENSE.txt Lic. Documentation
Accessible without login Plain text file README.md Data Auxiliary data

  Files folder image Files  /  css  
File Role Description
  Accessible without login Plain text file index.css Data Auxiliary data

  Files folder image Files  /  images  
File Role Description
  Accessible without login Image file php.ico Data Auxiliary data

  Files folder image Files  /  ModelHtml  
File Role Description
  Plain text file ModelHtml.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:220
This week:2
All time:8,254
This week:220Up