I am trying to reproduce the following markup with php-class-html-generator, but I am stuck with inserting <i> and setting text at the end, just before </h4>
Original HTML
<h4 class="formTitle lead">
<span class="widget-number"><i class="icon-comments"></i></span>Random
</h4>
My Code:
$h4 = HTMLTag::createElement('h4')->setText("Random")
->addClass('formTitle')
->addClass('lead');
$h4->addElement('span')
->addClass('widget-number');
return($h4);
My output at the moment:
<h4 class="formTitle lead">
<span class="widget-number">Random</span>
</h4>
Thanks for your help!
upvoting allfor this great find, cheers!