Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Editable Class Reference
Inheritance diagram for Editable:
AbstractBlock RendererInterface DataObject BlockInterface

Public Member Functions

 __construct (\Magento\Framework\View\Element\Context $context, \Magento\Framework\Translate\InlineInterface $inlineTranslate, array $data=[])
 
 render (\Magento\Framework\Data\Form\Element\AbstractElement $element)
 
- Public Member Functions inherited from AbstractBlock
 __construct (\Magento\Framework\View\Element\Context $context, array $data=[])
 
 getJsLayout ()
 
 getRequest ()
 
 getParentBlock ()
 
 setLayout (\Magento\Framework\View\LayoutInterface $layout)
 
 getLayout ()
 
 setNameInLayout ($name)
 
 getChildNames ()
 
 setAttribute ($name, $value=null)
 
 setChild ($alias, $block)
 
 addChild ($alias, $block, $data=[])
 
 unsetChild ($alias)
 
 unsetCallChild ($alias, $callback, $result, $params)
 
 unsetChildren ()
 
 getChildBlock ($alias)
 
 getChildHtml ($alias='', $useCache=true)
 
 getChildChildHtml ($alias, $childChildAlias='', $useCache=true)
 
 getBlockHtml ($name)
 
 insert ($element, $siblingName=0, $after=true, $alias='')
 
 append ($element, $alias='')
 
 getGroupChildNames ($groupName)
 
 getChildData ($alias, $key='')
 
 getUiId ($arg1=null, $arg2=null, $arg3=null, $arg4=null, $arg5=null)
 
 getJsId ($arg1=null, $arg2=null, $arg3=null, $arg4=null, $arg5=null)
 
 getUrl ($route='', $params=[])
 
 getViewFileUrl ($fileId, array $params=[])
 
 formatDate ( $date=null, $format=\IntlDateFormatter::SHORT, $showTime=false, $timezone=null)
 
 formatTime ( $time=null, $format=\IntlDateFormatter::SHORT, $showDate=false)
 
 getModuleName ()
 
 escapeHtml ($data, $allowedTags=null)
 
 escapeJs ($string)
 
 escapeHtmlAttr ($string, $escapeSingleQuote=true)
 
 escapeCss ($string)
 
 stripTags ($data, $allowableTags=null, $allowHtmlEntities=false)
 
 escapeUrl ($string)
 
 escapeXssInUrl ($data)
 
 escapeQuote ($data, $addSlashes=false)
 
 escapeJsQuote ($data, $quote='\'')
 
 getNameInLayout ()
 
 getCacheKeyInfo ()
 
 getCacheKey ()
 
 getVar ($name, $module=null)
 
 isScopePrivate ()
 
- 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)
 
- Public Member Functions inherited from BlockInterface
 toHtml ()
 
- Public Member Functions inherited from RendererInterface
 render (\Magento\Framework\Data\Form\Element\AbstractElement $element)
 

Protected Attributes

 $inlineTranslate
 
- Protected Attributes inherited from AbstractBlock
 $_design
 
 $_session
 
 $_sidResolver
 
 $_nameInLayout
 
 $_layout
 
 $jsLayout = []
 
 $_request
 
 $_urlBuilder
 
 $_eventManager
 
 $_frontController
 
 $_assetRepo
 
 $_viewConfig
 
 $_cacheState
 
 $_logger
 
 $_escaper
 
 $filterManager
 
 $_localeDate
 
 $inlineTranslation
 
 $_isScopePrivate = false
 
 $_scopeConfig
 
 $_cache
 
- Protected Attributes inherited from DataObject
 $_data = []
 

Additional Inherited Members

- Static Public Member Functions inherited from AbstractBlock
static extractModuleName ($className)
 
- Data Fields inherited from AbstractBlock
const CACHE_GROUP = \Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER
 
const CACHE_KEY_PREFIX = 'BLOCK_'
 
- Protected Member Functions inherited from AbstractBlock
 _construct ()
 
 _prepareLayout ()
 
 _beforeToHtml ()
 
 _afterToHtml ($html)
 
 _toHtml ()
 
 _getNotFoundUrl ($route='', $params=['_direct'=> 'core/index/notFound'])
 
 getCacheTags ()
 
 getCacheLifetime ()
 
 _loadCache ()
 
 _saveCache ($data)
 
 _getSidPlaceholder ($cacheKey=null)
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

@api

Since
100.0.2

Definition at line 15 of file Editable.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\View\Element\Context  $context,
\Magento\Framework\Translate\InlineInterface  $inlineTranslate,
array  $data = [] 
)
Parameters
\Magento\Framework\View\Element\Context$context
\Magento\Framework\Translate\InlineInterface$inlineTranslate
array$data

Definition at line 27 of file Editable.php.

31  {
32  $this->inlineTranslate = $inlineTranslate;
33  parent::__construct($context, $data);
34  }

Member Function Documentation

◆ render()

Render element

Parameters
\Magento\Framework\Data\Form\Element\AbstractElement$element
Returns
string
See also
RendererInterface::render()

Definition at line 44 of file Editable.php.

45  {
46  $element->addClass('element-value-changer');
47  $valueName = $element->getValueName();
48 
49  if ($valueName === '') {
50  $valueName = '...';
51  }
52 
53  if ($element->getShowAsText()) {
54  $html = ' <input type="hidden" class="hidden" id="' .
55  $element->getHtmlId() .
56  '" name="' .
57  $element->getName() .
58  '" value="' .
59  $element->getValue() .
60  '" data-form-part="' .
61  $element->getData('data-form-part') .
62  '"/> ' .
63  htmlspecialchars(
64  $valueName
65  ) . '&nbsp;';
66  } else {
67  $html = ' <span class="rule-param"' .
68  ($element->getParamId() ? ' id="' .
69  $element->getParamId() .
70  '"' : '') .
71  '>' .
72  '<a href="javascript:void(0)" class="label">';
73 
74  if ($this->inlineTranslate->isAllowed()) {
75  $html .= $this->escapeHtml($valueName);
76  } else {
77  $html .= $this->escapeHtml(
78  $this->filterManager->truncate($valueName, ['length' => 33, 'etc' => '...'])
79  );
80  }
81 
82  $html .= '</a><span class="element"> ' . $element->getElementHtml();
83 
84  if ($element->getExplicitApply()) {
85  $html .= ' <a href="javascript:void(0)" class="rule-param-apply"><img src="' . $this->getViewFileUrl(
86  'images/rule_component_apply.gif'
87  ) . '" class="v-middle" alt="' . __(
88  'Apply'
89  ) . '" title="' . __(
90  'Apply'
91  ) . '" /></a> ';
92  }
93 
94  $html .= '</span></span>&nbsp;';
95  }
96 
97  return $html;
98  }
__()
Definition: __.php:13
$element
Definition: element.phtml:12

Field Documentation

◆ $inlineTranslate

$inlineTranslate
protected

Definition at line 20 of file Editable.php.


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