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
Template.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\View\TemplateEngine\Xhtml
;
7
11
class
Template
12
{
13
const
XML_VERSION
=
'1.0'
;
14
15
const
XML_ENCODING
=
'UTF-8'
;
16
20
protected
$logger
;
21
25
protected
$templateNode
;
26
31
public
function
__construct
(
32
\Psr\Log\LoggerInterface
$logger
,
33
$content
34
) {
35
$this->logger =
$logger
;
36
$document = new \DOMDocument(static::XML_VERSION, static::XML_ENCODING);
37
$document->loadXML(
$content
);
38
$this->templateNode = $document->documentElement;
39
}
40
46
public
function
getDocumentElement
()
47
{
48
return
$this->templateNode
;
49
}
50
57
public
function
append
(
$content
)
58
{
59
$newFragment = $this->templateNode->ownerDocument->createDocumentFragment();
60
$newFragment->appendXML(
$content
);
61
$this->templateNode->appendChild($newFragment);
62
}
63
69
public
function
__toString
()
70
{
71
try
{
72
$this->templateNode->ownerDocument->normalizeDocument();
73
$result
= $this->templateNode->ownerDocument->saveHTML();
74
}
catch
(\Exception $e) {
75
$this->logger->critical($e->getMessage());
76
$result
=
''
;
77
}
78
return
$result
;
79
}
80
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Framework\View\TemplateEngine\Xhtml\Template\$templateNode
$templateNode
Definition:
Template.php:25
Magento\Framework\View\TemplateEngine\Xhtml\Template\$logger
$logger
Definition:
Template.php:20
Magento\Framework\View\TemplateEngine\Xhtml\Template\append
append($content)
Definition:
Template.php:57
Magento\Framework\View\TemplateEngine\Xhtml\Template\__toString
__toString()
Definition:
Template.php:69
Magento\Framework\View\TemplateEngine\Xhtml\Template\XML_VERSION
const XML_VERSION
Definition:
Template.php:13
Magento\Framework\View\TemplateEngine\Xhtml\Template\getDocumentElement
getDocumentElement()
Definition:
Template.php:46
Magento\Framework\View\TemplateEngine\Xhtml\Template\XML_ENCODING
const XML_ENCODING
Definition:
Template.php:15
Magento\Framework\View\TemplateEngine\Xhtml
$content
$content
Definition:
downloadable_product_with_files_and_sample_url.php:93
Magento\Framework\View\TemplateEngine\Xhtml\Template\__construct
__construct(\Psr\Log\LoggerInterface $logger, $content)
Definition:
Template.php:31
Magento\Framework\View\TemplateEngine\Xhtml\Template
Definition:
Template.php:11