HTML - a PHP-based HTML Markup generator

The main benefits are:

The main downfalls are:

This project is inspired by the CakePHP HtmlHelper.

Demo-/Testpage
Documentation(phpDocumentor)

Installation

Wordpress

  1. Download the latest "alldeps" branch
  2. Extract the archive and upload the plugin into the /wp-content/plugins/ directory of your wordpress project.
  3. Activate the plugin through the 'Plugins' menu in WordPress

Standalone

Use composer and require "xiphe/html": "2.0.*"

or download the latest "alldeps" branch, extract it and put it anywhere in your php project. Then include [path to]/bootstrap.php or [path to]/vendor/autoload.php .

Basic Usage

Follow the Installation steps to initiate the global $HTML variable.

```php <?php /* Get access to an instance of Xiphe\HTML */ global $HTML

/* Opens a std HTML5 header - leaves you inside the / $HTML->HTML5() / print a <em>/ ->title('HTML Example') /</em> close the <head> tag <em>/ ->close('head') /</em> open a <body>tag (s<em>[tag] will just open a [tag] - no </em> will be echoed) */ ->s</body> body() /* open a <div> tag with the class attribute "wrap" <em>/ ->s_div('.wrap') /</em> open an <article> tag with an id <em>/ ->s_article('#article1') /</em> print a <h1> with multiple attributes <em>/ ->h1('Hello Stranger', array('style' => 'color: red;', 'rel' => 'title')) /</em> <3> p('Thank you for checking out Xiphe\HTML - that\'s very kind of you') /* Another way to pass multiple attributes to a tag <em>/ ->img('src=http://upload.wikimedia.org/wikipedia/commons/c/ce/Example_image.png|alt=example') / </em> close all Tags that have been opened previously */ ->close('all'); ``` </3> <p>Output:</p> <p> ```html <!DOCTYPE HTML> <html class="no-js"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible" /> <title>HTML Example

Hello Stranger

Thank you for checking out Xiphe\HTML - that's very kind of you

example

```

Want to dig deeper? poke me to write a better documentation. Or check out the Test/Examples Hybrid on html.xiphe.net.

3rd Party

Changelog

2.0.10

2.0.9

2.0.8

2.0.7

2.0.6

2.0.5

2.0.4

2.0.3

2.0.2

2.0.1

2.0.0

pre 2.0

Bugs

Todo