I am trying to reproduce the following markup with php-class-html-generator , but I am stuck with the insert <i> and setting the text at the end, before </h4>
Original html
<h4 class="formTitle lead"> <span class="widget-number"><i class="icon-comments"></i></span>Random </h4>
My code is:
$h4 = HTMLTag::createElement('h4')->setText("Random") ->addClass('formTitle') ->addClass('lead'); $h4->addElement('span') ->addClass('widget-number'); return($h4);
My conclusion at the moment:
<h4 class="formTitle lead"> <span class="widget-number">Random</span> </h4>
Thank you for your help!
source share