PHP code example of xiphe / html
1. Go to this page and download the library: Download xiphe/html library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
xiphe / html example snippets
/* Get access to an instance of Xiphe\HTML */
global $HTML
/* Opens a std HTML5 header - leaves you inside the <head> */
$HTML->HTML5()
/* print a <title> */
->title('HTML Example')
/* close the <head> tag */
->close('head')
/* open a <body> tag (s_[tag] will just open a [tag] - no </tag> will be echoed) */
->s_body()
/* open a <div> tag with the class attribute "wrap" */
->s_div('.wrap')
/* open an <article> tag with an id */
->s_article('#article1')
/* print a <h1> with multiple attributes */
->h1('Hello Stranger', array('style' => 'color: red;', 'rel' => 'title'))
/* <3 */
->p('Thank you for checking out Xiphe\HTML - that\'s very kind of you')
/* Another way to pass multiple attributes to a tag */
->img('src=http://upload.wikimedia.org/wikipedia/commons/c/ce/Example_image.png|alt=example')
/* close all Tags that have been opened previously */
->close('all');