File: D:/HostingSpaces/SBogers10/rentman2019.komma.pro/app/Komma/Dynamic/ComponentType/Types/Text.php
<?php
namespace App\Komma\Dynamic\ComponentType\Types;
use App\Komma\Dynamic\ComponentType\ComponentTypes;
use App\Komma\Kms\Core\Attributes\Attribute;
use App\Komma\Kms\Core\Attributes\OnOff;
use App\Komma\Kms\Core\Attributes\TextArea;
class Text extends AbstractComponentType
{
//Set an id that corresponds to the ComponentTypes enum
protected $id = ComponentTypes::TEXT;
//Set icon and name
protected $name = 'text';
protected $translatableAttributes = ['text'];
public function __construct()
{
parent::__construct();
//Set the attributes
$this->attributes->push((new OnOff())
->setLabelText('Grey Background')
->setStyleClass('is-background-option')
->mapValueFrom(Attribute::ValueFromItself, 'grey_background')
);
$this->attributes->push((new TextArea())
->enableTinymceEditorOnClick()
->setLabelText('text')
->setPlaceholderText('Ex. Lorum ipsum')
->mapValueFrom(Attribute::ValueFromItself, 'text')
);
$this->attributes->push((new OnOff())
->setLabelText('Intro')
->mapValueFrom(Attribute::ValueFromItself, 'intro'));
}
}