I have this in php:
'position' => [
'label' => ['Pic Position', ''],
'inputType' => 'select',
#'default' => 'left',
'options' => [
'left' => 'Left',
'right' => 'Right',
],
]
now i want if 'Left' is selected, that a class called left is added to a div! I cannot figure out the php syntax for that!
<div class="floating_text" <?php if ($this->position == 'left') echo 'class="left"' ?>>
<?= $this->text ?>
</div>
this is clearly wrong!
$this->positionand see if it holdsleftorright. Also, don't add twoclass=..., add it to the already existingclassattribute. Also remember that PHP is serverside so if you want to change that value via a<select>you'd first need to submit the changes or use Javascript to attach that class onChange