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-customer
Block
Account
Navigation.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\Customer\Block\Account
;
9
10
use \Magento\Framework\View\Element\Html\Links;
11
use \Magento\Customer\Block\Account\SortLinkInterface;
12
19
class
Navigation
extends
Links
20
{
25
public
function
getLinks
()
26
{
27
$links
= $this->_layout->getChildBlocks($this->
getNameInLayout
());
28
$sortableLink = [];
29
foreach
(
$links
as $key =>
$link
) {
30
if
(
$link
instanceof
SortLinkInterface
) {
31
$sortableLink[] =
$link
;
32
unset(
$links
[$key]);
33
}
34
}
35
36
usort($sortableLink, [$this,
"compare"
]);
37
return
array_merge($sortableLink,
$links
);
38
}
39
48
private
function
compare(
SortLinkInterface
$firstLink,
SortLinkInterface
$secondLink): int
49
{
50
return
$secondLink->
getSortOrder
() <=> $firstLink->
getSortOrder
();
51
}
52
}
Magento\Framework\View\Element\AbstractBlock\getNameInLayout
getNameInLayout()
Definition:
AbstractBlock.php:1004
Magento\Customer\Block\Account\Navigation
Definition:
Navigation.php:19
$link
$link
Definition:
quote_with_downloadable_product.php:27
Magento\Customer\Block\Account\SortLinkInterface\getSortOrder
getSortOrder()
$links
$links
Definition:
downloadable_product_with_files_and_sample_url.php:39
Magento\Customer\Block\Account
Magento\Framework\View\Element\Html\Links
Definition:
Links.php:14
Magento\Customer\Block\Account\Navigation\getLinks
getLinks()
Definition:
Navigation.php:25
Magento\Customer\Block\Account\SortLinkInterface
Definition:
SortLinkInterface.php:14