Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-ui
Component
Form
Element
Wysiwyg.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Ui\Component\Form\Element
;
7
8
use
Magento\Framework\Data\Form\Element\Editor
;
9
use
Magento\Framework\Data\Form
;
10
use
Magento\Framework\Data\FormFactory
;
11
use
Magento\Framework\DataObject
;
12
use
Magento\Framework\View\Element\UiComponent\ContextInterface
;
13
use
Magento\Ui\Component\Wysiwyg\ConfigInterface
;
14
21
class
Wysiwyg
extends
AbstractElement
22
{
23
const
NAME
=
'wysiwyg'
;
24
29
protected
$form
;
30
35
protected
$editor
;
36
45
public
function
__construct
(
46
ContextInterface
$context
,
47
FormFactory
$formFactory,
48
ConfigInterface
$wysiwygConfig,
49
array
$components
= [],
50
array
$data
= [],
51
array
$config
= []
52
) {
53
$wysiwygConfigData = isset(
$config
[
'wysiwygConfigData'
]) ?
$config
[
'wysiwygConfigData'
] : [];
54
$this->
form
= $formFactory->create();
55
$wysiwygId =
$context
->getNamespace() .
'_'
.
$data
[
'name'
];
56
$this->editor = $this->
form
->addField(
57
$wysiwygId,
58
\
Magento
\Framework\Data\
Form
\Element\Editor::class,
59
[
60
'force_load'
=>
true
,
61
'rows'
=> isset(
$config
[
'rows'
]) ?
$config
[
'rows'
] : 20,
62
'name'
=>
$data
[
'name'
],
63
'config'
=> $wysiwygConfig->
getConfig
($wysiwygConfigData),
64
'wysiwyg'
=> isset(
$config
[
'wysiwyg'
]) ?
$config
[
'wysiwyg'
] :
null
,
65
]
66
);
67
$data
[
'config'
][
'content'
] = $this->editor->getElementHtml();
68
$data
[
'config'
][
'wysiwygId'
] = $wysiwygId;
69
70
parent::__construct(
$context
,
$components
,
$data
);
71
}
72
79
public
function
getComponentName
()
80
{
81
return
static::NAME;
82
}
83
}
Magento\Framework\Data\FormFactory
Definition:
FormFactory.php:12
Magento\Framework\View\Element\UiComponent\ContextInterface
Definition:
ContextInterface.php:17
Magento\Ui\Component\Form\Element\Wysiwyg\__construct
__construct(ContextInterface $context, FormFactory $formFactory, ConfigInterface $wysiwygConfig, array $components=[], array $data=[], array $config=[])
Definition:
Wysiwyg.php:45
Magento\Ui\Component\Wysiwyg\ConfigInterface\getConfig
getConfig()
$config
$config
Definition:
fraud_order.php:17
Magento\Ui\Component\Form\Element\Wysiwyg\NAME
const NAME
Definition:
Wysiwyg.php:23
form
jquery extjs ext tree mage adminhtml form
Definition:
tree.phtml:41
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Ui\Component\Wysiwyg\ConfigInterface
Definition:
ConfigInterface.php:11
Magento\Ui\Component\AbstractComponent\$context
$context
Definition:
AbstractComponent.php:31
Magento
Magento\Ui\Component\Form\Element\Wysiwyg\$form
$form
Definition:
Wysiwyg.php:29
Magento\Ui\Component\Form\Element\Wysiwyg\getComponentName
getComponentName()
Definition:
Wysiwyg.php:79
Magento\Framework\Data\Form
Definition:
Form.php:21
Magento\Framework\Data\Form
Definition:
AbstractForm.php:6
Magento\Ui\Component\Form\Element\Wysiwyg
Definition:
Wysiwyg.php:21
Magento\Ui\Component\AbstractComponent\$components
$components
Definition:
AbstractComponent.php:36
Magento\Ui\Component\Form\Element
Definition:
AbstractElement.php:6
Magento\Framework\Data\Form\Element\Editor
Definition:
Editor.php:16
Magento\Framework\Data\Form\Element\AbstractElement
Definition:
AbstractElement.php:21
Magento\Ui\Component\Form\Element\Wysiwyg\$editor
$editor
Definition:
Wysiwyg.php:35
Magento\Framework\DataObject
Definition:
Cache.php:6