PHP code example of joaorobertopb / htmlable
1. Go to this page and download the library: Download joaorobertopb/htmlable 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/ */
joaorobertopb / htmlable example snippets
php
$div = new JoaoRobertoPB\Htmlable\Tag('div');
$div->add('Hello, Htmlable!');
$div->render();
php
$h1 = new Tag('h1');
$h1->add("Header");
$h1->render();
php
$a = new Tag('a');
$a->id = "example";
$a->href = "#";
$a->add("Link");
$a->render();
//Or attributes via construct method
$a = new Tag('a',['id'=>"example", 'href'=>"#"]);
$a->add("Link");
$a->render();