1. Go to this page and download the library: Download netzmacht/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/ */
netzmacht / html example snippets
$attributes = new Netzmacht\Html\Attributes();
$attributes
->setId('a_id')
->addClass('a_class')
->setAttribute('data-target', '#some');
$factory = new Netzmacht\Html\Factory\ElementFactory();
$paragraph = $factory->create('p', array('id' => 'a_id', 'class' => array('description'));
$label = $factory->create('span');
$label
->addClass('label')
->addChild('Label this');
$paragraph
->addChild('This is a paragraph.')
->addChild(' '); // add space between both elements
->addChild($label, Netzmacht\Html\Element\Node::POSITION_FIRST); // add at first position
<article>
<?= $paragraph;
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.