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
HtmlContent.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Ui\Component
;
7
8
use
Magento\Framework\View\Element\BlockInterface
;
9
use
Magento\Framework\View\Element\UiComponent\BlockWrapperInterface
;
10
use
Magento\Framework\View\Element\UiComponent\ContextInterface
;
11
12
class
HtmlContent
extends
AbstractComponent
implements
BlockWrapperInterface
13
{
14
const
NAME
=
'html_content'
;
15
19
protected
$block
;
20
27
public
function
__construct
(
28
ContextInterface
$context
,
29
BlockInterface
$block
,
30
array
$components
= [],
31
array
$data
= []
32
) {
33
parent::__construct(
$context
,
$components
,
$data
);
34
$this->block =
$block
;
35
}
36
42
public
function
getBlock
()
43
{
44
return
$this->block
;
45
}
46
52
public
function
getComponentName
()
53
{
54
return
static::NAME;
55
}
56
60
public
function
render
()
61
{
62
return
$this->
getData
(
'config/content'
) ?: $this->block->toHtml();
63
}
64
68
public
function
getConfiguration
()
69
{
70
$configuration
= parent::getConfiguration();
71
if
($this->
getData
(
'wrapper/canShow'
) !==
false
) {
72
if
($this->
getData
(
'isAjaxLoaded'
)) {
73
$configuration
[
'url'
] = $this->
getData
(
'url'
);
74
}
else
{
75
if
(!$this->
getData
(
'config/content'
)) {
//add html block cony into cache
76
$content
= $this->block->toHtml();
77
$this->
addData
([
'config'
=> [
'content'
=>
$content
]]);
78
}
79
80
$configuration
[
'content'
] = $this->
getData
(
'config/content'
);
81
}
82
if
($this->
getData
(
'wrapper'
)) {
83
$configuration
= array_merge($this->
getData
(), $this->
getData
(
'wrapper'
));
84
}
85
}
86
return
$configuration
;
87
}
88
}
Magento\Ui\Component\AbstractComponent
Definition:
AbstractComponent.php:24
Magento\Ui\Component\HtmlContent\render
render()
Definition:
HtmlContent.php:60
Magento\Framework\View\Element\UiComponent\ContextInterface
Definition:
ContextInterface.php:17
$configuration
$configuration
Definition:
index.php:33
Magento\Ui\Component\AbstractComponent\getData
getData($key='', $index=null)
Definition:
AbstractComponent.php:264
Magento\Framework\View\Element\UiComponent\BlockWrapperInterface
Definition:
BlockWrapperInterface.php:14
Magento\Framework\DataObject\addData
addData(array $arr)
Definition:
DataObject.php:52
Magento\Ui\Component\HtmlContent\getBlock
getBlock()
Definition:
HtmlContent.php:42
Magento\Ui\Component\HtmlContent\getConfiguration
getConfiguration()
Definition:
HtmlContent.php:68
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Ui\Component\HtmlContent\NAME
const NAME
Definition:
HtmlContent.php:14
Magento\Ui\Component\HtmlContent\$block
$block
Definition:
HtmlContent.php:19
Magento\Ui\Component\HtmlContent\getComponentName
getComponentName()
Definition:
HtmlContent.php:52
Magento\Ui\Component\AbstractComponent\$context
$context
Definition:
AbstractComponent.php:31
Magento\Framework\View\Element\BlockInterface
Definition:
BlockInterface.php:16
$content
$content
Definition:
downloadable_product_with_files_and_sample_url.php:93
Magento\Ui\Component\HtmlContent\__construct
__construct(ContextInterface $context, BlockInterface $block, array $components=[], array $data=[])
Definition:
HtmlContent.php:27
Magento\Ui\Component\AbstractComponent\$components
$components
Definition:
AbstractComponent.php:36
Magento\Ui\Component
Definition:
ConfigurationTest.php:6
Magento\Ui\Component\HtmlContent
Definition:
HtmlContent.php:12