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
Element
Html
Links.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\View\Element\Html
;
7
14
class
Links
extends
\Magento\Framework\View\Element\Template
15
{
21
public
function
getLinks
()
22
{
23
return
$this->_layout->getChildBlocks($this->
getNameInLayout
());
24
}
25
32
protected
function
getLinkByPath
(
$path
)
33
{
34
foreach
($this->
getLinks
() as
$link
) {
35
if
(
$link
->getPath() ==
$path
) {
36
return
$link
;
37
}
38
}
39
}
40
47
public
function
setActive
(
$path
)
48
{
49
$link
= $this->
getLinkByPath
(
$path
);
50
if
(
$link
) {
51
$link
->setIsHighlighted(
true
);
52
}
53
}
54
61
public
function
renderLink
(\
Magento
\Framework\View\
Element
\
AbstractBlock
$link
)
62
{
63
return
$this->_layout->renderElement(
$link
->getNameInLayout());
64
}
65
71
protected
function
_toHtml
()
72
{
73
if
(
false
!= $this->
getTemplate
()) {
74
return
parent::_toHtml();
75
}
76
77
$html =
''
;
78
if
($this->
getLinks
()) {
79
$html =
'<ul'
. ($this->hasCssClass() ?
' class="'
. $this->
escapeHtml
(
80
$this->getCssClass()
81
) .
'"'
:
''
) .
'>'
;
82
foreach
($this->
getLinks
() as
$link
) {
83
$html .= $this->
renderLink
(
$link
);
84
}
85
$html .=
'</ul>'
;
86
}
87
88
return
$html;
89
}
90
}
Magento\Framework\View\Element\AbstractBlock\getNameInLayout
getNameInLayout()
Definition:
AbstractBlock.php:1004
Magento\Framework\View\Element\Html
Definition:
Calendar.php:6
Magento\Framework\View\Element\Html\Links\getLinks
getLinks()
Definition:
Links.php:21
Magento\Framework\View\Element\AbstractBlock
Definition:
AbstractBlock.php:25
Magento\Framework\View\Layout\Element
Definition:
Element.php:14
$link
$link
Definition:
quote_with_downloadable_product.php:27
Magento\Framework\View\Element\AbstractBlock\escapeHtml
escapeHtml($data, $allowedTags=null)
Definition:
AbstractBlock.php:890
Magento\Framework\View\Element\Html\Links\renderLink
renderLink(\Magento\Framework\View\Element\AbstractBlock $link)
Definition:
Links.php:61
Magento\Framework\View\Element\Html\Links\_toHtml
_toHtml()
Definition:
Links.php:71
Magento\Framework\View\Element\Html\Links
Definition:
Links.php:14
Magento\Framework\View\Element\Template\getTemplate
getTemplate()
Definition:
Template.php:192
Magento
Magento\Framework\View\Element\Template
Definition:
Template.php:32
Magento\Framework\View\Element\Html\Links\setActive
setActive($path)
Definition:
Links.php:47
Magento\Framework\View\Element\Html\Links\getLinkByPath
getLinkByPath($path)
Definition:
Links.php:32
$path
$path
Definition:
import_with_filesystem_images.php:14