File: D:/HostingSpaces/SBogers10/farmfun.komma.pro/app/Komma/Components/ComponentType/Types/TextForm.php
<?php
namespace App\Komma\Components\ComponentType\Types;
use App\Komma\Components\ComponentType\ComponentTypes;
use App\Komma\Kms\Core\Attributes\Attribute;
use App\Komma\Kms\Core\Attributes\OnOff;
use App\Komma\Kms\Core\Attributes\Seperator;
use App\Komma\Kms\Core\Attributes\TextArea;
use App\Komma\Kms\Core\Attributes\TextField;
class TextForm extends AbstractComponentType
{
public function __construct()
{
//Set an id that corresponds to the ComponentTypes enum
$this->id = ComponentTypes::TEXT_FORM;
//Set icon and name
$this->name = 'text-form';
parent::__construct();
$this->attributes->push((new TextArea())
->enableTinymceEditor()
->setLabelText('tekst')
->mapValueFrom(Attribute::ValueFromComponent, 'text')
);
$this->attributes->push(new Seperator());
$this->attributes->push((new TextField('Form titel'))
->mapValueFrom(Attribute::ValueFromComponent, 'form_title')
);
$this->attributes->push((new OnOff())
->setLabelText('Met nieuwsbrief checkbox')
->switchOn()
->mapValueFrom(Attribute::ValueFromComponent, 'with_newsletter')
);
$this->attributes->push((new OnOff())
->setLabelText('Met aanbreng formulier')
->mapValueFrom(Attribute::ValueFromComponent, 'with_application_form')
);
$this->attributes->push(new Seperator());
$this->attributes->push((new OnOff())
->setLabelText('Omwisselen Tekst/Formulier')
->mapValueFrom(Attribute::ValueFromComponent, 'reversed')
);
}
}