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
TemplateEngineFactory.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\View
;
7
8
use
Magento\Framework\ObjectManagerInterface
;
9
13
class
TemplateEngineFactory
14
{
20
protected
$objectManager
;
21
27
protected
$engines
;
28
35
public
function
__construct
(
ObjectManagerInterface
$objectManager
, array
$engines
)
36
{
37
$this->objectManager =
$objectManager
;
38
$this->engines =
$engines
;
39
}
40
49
public
function
create
(
$name
)
50
{
51
if
(!isset($this->engines[
$name
])) {
52
throw
new \InvalidArgumentException(
"Unknown template engine type: '{$name}'."
);
53
}
54
$engineClass = $this->engines[
$name
];
55
$engineInstance = $this->objectManager->create($engineClass);
56
if
(!$engineInstance instanceof \
Magento
\Framework\View\
TemplateEngineInterface
) {
57
throw
new \UnexpectedValueException(
"{$engineClass} has to implement the template engine interface."
);
58
}
59
return
$engineInstance;
60
}
61
}
Magento\Framework\View\TemplateEngineInterface
Definition:
TemplateEngineInterface.php:11
Magento\Framework\ObjectManagerInterface
Definition:
ObjectManagerInterface.php:12
Magento\Framework\View\TemplateEngineFactory\$engines
$engines
Definition:
TemplateEngineFactory.php:27
Magento\Framework\View\TemplateEngineFactory\__construct
__construct(ObjectManagerInterface $objectManager, array $engines)
Definition:
TemplateEngineFactory.php:35
Magento\Framework\View\TemplateEngineFactory\$objectManager
$objectManager
Definition:
TemplateEngineFactory.php:20
Magento\Framework\View\TemplateEngineFactory\create
create($name)
Definition:
TemplateEngineFactory.php:49
Magento
Magento\Framework\View\TemplateEngineFactory
Definition:
TemplateEngineFactory.php:13
Magento\Framework\View
$name
if(!isset($_GET['name'])) $name
Definition:
log.php:14