Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Link.php
Go to the documentation of this file.
1 <?php
10 namespace Magento\Wishlist\Block;
11 
13 
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 }
getData($key='', $index=null)
Definition: DataObject.php:119
$wishlistHelper
Definition: sidebar.phtml:12
__()
Definition: __.php:13