Created
April 10, 2022 17:03
-
-
Save estefanionsantos/2216efde98bf9e45b083de8a95cab751 to your computer and use it in GitHub Desktop.
image element
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Rubricate\Element\CreateElement; | |
$i1 = new CreateElement('img'); | |
$i1->setAttribute('src', 'image.png'); | |
$i2 = new CreateElement('img'); | |
$i2->setAttribute('src', 'image.png'); | |
$i2->setAttribute('class', 'img-circle'); | |
$i3 = new CreateElement('img'); | |
$i3->setAttribute('src', 'image.png'); | |
$i3->setAttribute('style', 'border: 0'); | |
$a3 = new CreateElement('a'); | |
$a3->setAttribute('href', '#'); | |
$a3->addChild($i3); | |
echo $i1->getElement(); | |
echo $i2->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