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
framework
View
TemplateEngine
Xhtml
ResultFactory.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\View\TemplateEngine\Xhtml
;
7
8
use
Magento\Framework\Phrase
;
9
use
Magento\Framework\Exception\LocalizedException
;
10
use
Magento\Framework\ObjectManagerInterface
;
11
15
class
ResultFactory
16
{
22
protected
$objectManager
;
23
29
protected
$instanceName
;
30
37
public
function
__construct
(
38
ObjectManagerInterface
$objectManager
,
39
$instanceName
= \
Magento
\Framework\View\TemplateEngine\
Xhtml
\ResultInterface::class
40
) {
41
$this->objectManager =
$objectManager
;
42
$this->instanceName =
$instanceName
;
43
}
44
52
public
function
create
(array
$arguments
= [])
53
{
54
$object = $this->objectManager->create($this->instanceName,
$arguments
);
55
56
if
(!($object instanceof
ResultInterface
)) {
57
throw
new
LocalizedException
(
new
Phrase
(
'This class must implement the "ResultInterface"'
));
58
}
59
60
return
$object;
61
}
62
}
Magento\Framework\Exception\LocalizedException
Definition:
LocalizedException.php:17
Magento\Framework\View\TemplateEngine\Xhtml\ResultFactory\$instanceName
$instanceName
Definition:
ResultFactory.php:29
Magento\Framework\View\TemplateEngine\Xhtml\ResultFactory\__construct
__construct(ObjectManagerInterface $objectManager, $instanceName=\Magento\Framework\View\TemplateEngine\Xhtml\ResultInterface::class)
Definition:
ResultFactory.php:37
Magento\Framework\ObjectManagerInterface
Definition:
ObjectManagerInterface.php:12
Magento\Framework\View\TemplateEngine\Xhtml\ResultFactory\$objectManager
$objectManager
Definition:
ResultFactory.php:22
Magento\Framework\View\TemplateEngine\Xhtml\ResultFactory
Definition:
ResultFactory.php:15
Magento
Magento\Framework\View\TemplateEngine\Xhtml
$arguments
$arguments
Definition:
final_price.phtml:24
Magento\Framework\View\TemplateEngine\Xhtml\ResultFactory\create
create(array $arguments=[])
Definition:
ResultFactory.php:52
Magento\Framework\View\TemplateEngine\Xhtml
Definition:
Xhtml.php:20
Magento\Framework\Phrase
Definition:
Phrase.php:17
Magento\Framework\Phrase
Magento\Framework\View\TemplateEngine\Xhtml\ResultInterface
Definition:
ResultInterface.php:11