Warning: You are browsing the documentation for PrestaShop 1.7, which is outdated.
You might want to read an updated version of this page for the current version, PrestaShop 8. Read the updated version of this page
Enables TinyMCE text editor on TextareaType.
Option | Type | Default value | Description |
---|---|---|---|
autoload | bool | true | Whether to automatically load TinyMCE editor, or no. |
limit | int | 21844 | Limit of characters in text field. By default value equals to max size of UTF-8 content available in MySQL text column |
In order to use TinyMCE editor in the PrestaShop UI Kit, you need to initialize its javascript component once the page is loaded:
$(document).ready(function () {
window.prestashop.component.initComponents(
[
"TinyMCEEditor"
],
);
});
<?php
// path/to/your/CustomType.php
use PrestaShopBundle\Form\Admin\Type\FormattedTextareaType;
class CustomType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add(
'test_text_field',
FormattedTextareaType::class
)
;
}
}