Created
September 8, 2021 00:59
-
-
Save estefanionsantos/eafd310006303a87252581d53bf616f6 to your computer and use it in GitHub Desktop.
text 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\TextForm; | |
use Rubricate\Form\LabelForm; | |
use Rubricate\Element\CreateElement; | |
$div = new CreateElement('div'); | |
$lab = new LabelForm('First Name:'); | |
$txt = new TextForm('firstName', 'john'); | |
$div->setAttribute('class', 'form-group'); | |
$lab->setAttribute('for', 'firstName'); | |
$txt->setAttribute('id', 'firstName'); | |
$div->addChild($lab); | |
$div->addChild($txt); | |
echo $div->getElement(); | |
/* | |
<div class="form-group"> | |
<label for="firstName">First Name:</label> | |
<input type="text" name="firstName" value="john" id="firstName" /> | |
</div> | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment