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
Wrapper
UiComponent.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Ui\Component\Wrapper
;
7
8
use
Magento\Framework\View\Element\Template
;
9
use
Magento\Framework\View\Element\UiComponentInterface
;
10
use
Magento\Framework\View\Element\UiComponent\ContainerInterface
;
11
use
Magento\Framework\View\Element\Template\Context
as TemplateContext;
12
18
class
UiComponent
extends
Template
implements
ContainerInterface
19
{
25
protected
$component
;
26
30
protected
$blockWrapperFactory
;
31
40
public
function
__construct
(
41
TemplateContext $context,
42
UiComponentInterface
$component
,
43
BlockFactory
$blockWrapperFactory
,
44
array
$data
= []
45
) {
46
$this->component =
$component
;
47
$this->blockWrapperFactory =
$blockWrapperFactory
;
48
$this->
setNameInLayout
($this->component->getName());
49
parent::__construct($context,
$data
);
50
}
51
57
protected
function
_toHtml
()
58
{
59
foreach
($this->
getChildNames
() as $childName) {
60
$childBlock = $this->
getLayout
()->getBlock($childName);
61
if
($childBlock) {
62
$wrapper = $this->blockWrapperFactory->create([
63
'block'
=> $childBlock,
64
'data'
=> [
65
'name'
=>
'block_'
. $childName
66
]
67
]);
68
$this->component->addComponent(
'block_'
. $childName, $wrapper);
69
}
70
}
71
72
$result
= $this->component->render();
73
return
(
string
)
$result
;
74
}
75
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Ui\Component\Wrapper\UiComponent\_toHtml
_toHtml()
Definition:
UiComponent.php:57
Magento\Framework\View\Element\Template
Definition:
Context.php:6
Magento\Ui\Component\Wrapper\UiComponent\__construct
__construct(TemplateContext $context, UiComponentInterface $component, BlockFactory $blockWrapperFactory, array $data=[])
Definition:
UiComponent.php:40
Magento\Framework\View\Element\UiComponentInterface
Definition:
UiComponentInterface.php:16
Magento\Framework\View\Element\AbstractBlock\getChildNames
getChildNames()
Definition:
AbstractBlock.php:328
Magento\Ui\Component\Wrapper\UiComponent\$component
$component
Definition:
UiComponent.php:25
Magento\Framework\View\Element\Template\Context
Definition:
Context.php:23
Magento\Ui\Component\Wrapper\UiComponent
Definition:
UiComponent.php:18
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Framework\View\Element\UiComponent\ContainerInterface
Definition:
ContainerInterface.php:13
Magento\Framework\View\Element\AbstractBlock\getLayout
getLayout()
Definition:
AbstractBlock.php:295
Magento\Ui\Component\Wrapper
Definition:
Block.php:6
Magento\Framework\View\Element\AbstractBlock\setNameInLayout
setNameInLayout($name)
Definition:
AbstractBlock.php:311
Magento\Framework\View\Element\Template
Definition:
Template.php:32
Magento\Ui\Component\Wrapper\UiComponent\$blockWrapperFactory
$blockWrapperFactory
Definition:
UiComponent.php:30