Skip to content

Instantly share code, notes, and snippets.

@estefanionsantos
Last active April 7, 2026 23:06
Show Gist options
  • Select an option

  • Save estefanionsantos/2216efde98bf9e45b083de8a95cab751 to your computer and use it in GitHub Desktop.

Select an option

Save estefanionsantos/2216efde98bf9e45b083de8a95cab751 to your computer and use it in GitHub Desktop.
image element
<?php
use Rubricate\Element\CreateElement;
$img1 = new CreateElement('img');
$img1->setAttribute('src', 'image.png');
$img2 = new CreateElement('img');
$img2->setAttribute('src', 'image.png');
$img2->setAttribute('class', 'img-circle');
$img3 = new CreateElement('img');
$img3->setAttribute('src', 'image.png');
$img3->setAttribute('style', 'border: 0');
$a3 = new CreateElement('a');
$a3->setAttribute('href', '#');
$a3->addChild($i3);
echo $img1->getElement();
echo $img2->getElement();
echo $a3->getElement();
/*
<img src="image.png" />
<img src="image.png" class="img-circle" />
<a href="#"><img src="image.png" style="border: 0" /></a>
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment