Skip to content

Instantly share code, notes, and snippets.

@estefanionsantos
Last active September 8, 2021 00:26
Show Gist options
  • Save estefanionsantos/6de0cb33b8771e2c8298879c79cbf365 to your computer and use it in GitHub Desktop.
Save estefanionsantos/6de0cb33b8771e2c8298879c79cbf365 to your computer and use it in GitHub Desktop.
file form rubricate
<?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