Limbu is the light markup builder a package for simple composition of markup in an object oriented way.
Just require the package using composer.
composer require naylonkessler/limbu
Import and create a tag object:
<?php
use Limbu\Limbu;
use Limbu\Elements\Img;
use Limbu\Elements\Tag;
// Using the factory
$factory = new Limbu();
$div = $factory->tag('div');
// Using the Tag class
$div = new Tag('div');
// Using a specialized class
$img = new Img(['src' => 'home-image-url.jpg']);