Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Attributes
Wysiwyg Class Reference
Inheritance diagram for Wysiwyg:
AbstractElement AbstractComponent ElementInterface DataObject UiComponentInterface UiComponentInterface BlockInterface BlockInterface Wysiwyg

Public Member Functions

 __construct (ContextInterface $context, FormFactory $formFactory, ConfigInterface $wysiwygConfig, array $components=[], array $data=[], array $config=[])
 
 getComponentName ()
 
- Public Member Functions inherited from AbstractElement
 getHtmlId ()
 
 getValue ()
 
 getFormInputName ()
 
 isReadonly ()
 
 getCssClasses ()
 
- Public Member Functions inherited from AbstractComponent
 __construct (ContextInterface $context, array $components=[], array $data=[])
 
 getContext ()
 
 getName ()
 
 prepare ()
 
 toHtml ()
 
 render ()
 
 addComponent ($name, UiComponentInterface $component)
 
 getComponent ($name)
 
 getChildComponents ()
 
 renderChildComponent ($name)
 
 getTemplate ()
 
 getConfiguration ()
 
 getJsConfig (UiComponentInterface $component)
 
 setData ($key, $value=null)
 
 getData ($key='', $index=null)
 
 prepareDataSource (array $dataSource)
 
 getDataSourceData ()
 
- Public Member Functions inherited from DataObject
 __construct (array $data=[])
 
 addData (array $arr)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 getDataByPath ($path)
 
 getDataByKey ($key)
 
 setDataUsingMethod ($key, $args=[])
 
 getDataUsingMethod ($key, $args=null)
 
 hasData ($key='')
 
 toArray (array $keys=[])
 
 convertToArray (array $keys=[])
 
 toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 toJson (array $keys=[])
 
 convertToJson (array $keys=[])
 
 toString ($format='')
 
 __call ($method, $args)
 
 isEmpty ()
 
 serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
 
 debug ($data=null, &$objects=[])
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 offsetGet ($offset)
 

Data Fields

const NAME = 'wysiwyg'
 

Protected Attributes

 $form
 
 $editor
 
- Protected Attributes inherited from AbstractComponent
 $context
 
 $components
 
 $componentData = []
 
 $dataSources = []
 
- Protected Attributes inherited from DataObject
 $_data = []
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractComponent
 prepareChildComponent (UiComponentInterface $component)
 
 initObservers (array & $data=[])
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

WYSIWYG form element

@api

Since
100.1.0

Definition at line 21 of file Wysiwyg.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( ContextInterface  $context,
FormFactory  $formFactory,
ConfigInterface  $wysiwygConfig,
array  $components = [],
array  $data = [],
array  $config = [] 
)
Parameters
ContextInterface$context
FormFactory$formFactory
ConfigInterface$wysiwygConfig
array$components
array$data
array$config

Definition at line 45 of file Wysiwyg.php.

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  }
$config
Definition: fraud_order.php:17
jquery extjs ext tree mage adminhtml form
Definition: tree.phtml:41

Member Function Documentation

◆ getComponentName()

getComponentName ( )

Get component name

Returns
string
Since
100.1.0

Implements UiComponentInterface.

Definition at line 79 of file Wysiwyg.php.

80  {
81  return static::NAME;
82  }

Field Documentation

◆ $editor

$editor
protected

Definition at line 35 of file Wysiwyg.php.

◆ $form

$form
protected

Definition at line 29 of file Wysiwyg.php.

◆ NAME

const NAME = 'wysiwyg'

Definition at line 23 of file Wysiwyg.php.


The documentation for this class was generated from the following file: