Created
September 8, 2021 01:02
-
-
Save estefanionsantos/74c4bfc668c98edb9303f2f565d57519 to your computer and use it in GitHub Desktop.
textarea 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\TextareaForm; | |
use Rubricate\Form\LabelForm; | |
use Rubricate\Element\CreateElement; | |
$div = new CreateElement('div'); | |
$lab = new LabelForm('Message:'); | |
$msg = new TextareaForm('message'); | |
/* | |
// or 2 arguments (value) | |
$msg = new TextareaForm('message', 'lorem ipsum dolor sit amet'); | |
*/ | |
$div->setAttribute('class', 'message'); | |
$lab->setAttribute('for', 'message'); | |
$msg->setAttribute('class', 'message'); | |
$msg->setAttribute('id', 'message'); | |
$div->addChild($lab); | |
$div->addChild($msg); | |
echo $div->getElement(); | |
/* | |
<div class="message"> | |
<label for="message">Message:</label> | |
<textarea name="message" class="message" id="message"></textarea> | |
</div> | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment