Last active
September 8, 2021 00:26
-
-
Save estefanionsantos/6de0cb33b8771e2c8298879c79cbf365 to your computer and use it in GitHub Desktop.
file form rubricate
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\Form\FileForm; | |
use Rubricate\Form\LabelForm; | |
use Rubricate\Element\CreateElement; | |
$grp = new CreateElement('div'); | |
$lab = new LabelForm('image:'); | |
$usr = new FileForm('image'); | |
$grp->setAttribute('class', 'form-group'); | |
$lab->setAttribute('for', 'image'); | |
$usr->setAttribute('id', 'image'); | |
$grp->addChild($lab); | |
$grp->addChild($usr); | |
echo $grp->getElement(); | |
/* | |
<div class="form-group"> | |
<label for="image">image:</label> | |
<input type="file" name="image" value id="image" /> | |
</div> | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment