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-wishlist
Block
Link.php
Go to the documentation of this file.
1
<?php
10
namespace
Magento\Wishlist\Block
;
11
12
use
Magento\Customer\Block\Account\SortLinkInterface
;
13
21
class
Link
extends
\Magento\Framework\View\Element\Html\Link
implements
SortLinkInterface
22
{
28
protected
$_template
=
'Magento_Wishlist::link.phtml'
;
29
33
protected
$_wishlistHelper
;
34
40
public
function
__construct
(
41
\
Magento
\Framework\View\Element\Template\
Context
$context,
42
\
Magento
\Wishlist\Helper\Data
$wishlistHelper
,
43
array
$data
= []
44
) {
45
$this->_wishlistHelper =
$wishlistHelper
;
46
parent::__construct($context,
$data
);
47
}
48
52
protected
function
_toHtml
()
53
{
54
if
($this->_wishlistHelper->isAllow()) {
55
return
parent::_toHtml();
56
}
57
return
''
;
58
}
59
63
public
function
getHref
()
64
{
65
return
$this->
getUrl
(
'wishlist'
);
66
}
67
71
public
function
getLabel
()
72
{
73
return
__
(
'My Wish List'
);
74
}
75
80
public
function
getSortOrder
()
81
{
82
return
$this->
getData
(self::SORT_ORDER);
83
}
84
}
Magento\Framework\DataObject\getData
getData($key='', $index=null)
Definition:
DataObject.php:119
$wishlistHelper
$wishlistHelper
Definition:
sidebar.phtml:12
Magento\Wishlist\Block\Link\_toHtml
_toHtml()
Definition:
Link.php:52
Magento\Wishlist\Block\Link\getSortOrder
getSortOrder()
Definition:
Link.php:80
Magento\Wishlist\Block
Magento\Wishlist\Block\Link\$_template
$_template
Definition:
Link.php:28
__
__()
Definition:
__.php:13
Magento\Wishlist\Block\Link\getHref
getHref()
Definition:
Link.php:63
Magento\Wishlist\Block\Link
Definition:
Link.php:21
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Framework\View\Element\AbstractBlock\getUrl
getUrl($route='', $params=[])
Definition:
AbstractBlock.php:773
Magento
Magento\Framework\View\Element\Html\Link
Definition:
Link.php:17
Magento\Wishlist\Block\Link\$_wishlistHelper
$_wishlistHelper
Definition:
Link.php:33
Magento\Wishlist\Block\Link\getLabel
getLabel()
Definition:
Link.php:71
Context
Definition:
ClassesForConstructorIntegrity.php:33
Magento\Wishlist\Block\Link\__construct
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Wishlist\Helper\Data $wishlistHelper, array $data=[])
Definition:
Link.php:40
Magento\Customer\Block\Account\SortLinkInterface
Definition:
SortLinkInterface.php:14