Cyrus was an experiment in building HTML with PHP–sort of a simplified recreation of the DOM. Is it useful? Debatable, although I did use it for a few projects years ago. Is it over-engineered? Oh, almost certainly. Is it interesting? Well, it was at the time, and building/using it definitely taught me a few things about using objects in PHP.
Mostly, though, I keep it here because I’ve got a soft spot for it and I think it’s an intriguing oddity.
$element = new Livy\Cyrus;
->content('Here is some content!')->display();
<div class="this-is-the-class">Here is some content!</div>
You can also generate more heavily nested elements:
$nest = new Livy\Cyrus;
->content("You've arrived at my web site!")->c()
<p>You've arrived at my web site!</p>
nest() allows allows you to nest elements even after you’ve closed an element:
$list = new Livy\Cryus;
foreach (['one', 'two', 'three'] as $item) :