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
AuthorizationLink.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Customer\Block\Account
;
7
8
use
Magento\Customer\Model\Context
;
9
use
Magento\Customer\Block\Account\SortLinkInterface
;
10
18
class
AuthorizationLink
extends
\Magento\Framework\View\Element\Html\Link
implements
SortLinkInterface
19
{
25
protected
$httpContext
;
26
30
protected
$_customerUrl
;
31
35
protected
$_postDataHelper
;
36
44
public
function
__construct
(
45
\
Magento
\Framework\View\Element\
Template
\
Context
$context,
46
\
Magento
\Framework\
App
\Http\
Context
$httpContext
,
47
\
Magento
\
Customer
\Model\
Url
$customerUrl
,
48
\
Magento
\Framework\Data\Helper\PostHelper $postDataHelper,
49
array
$data
= []
50
) {
51
parent::__construct($context,
$data
);
52
$this->httpContext =
$httpContext
;
53
$this->_customerUrl =
$customerUrl
;
54
$this->_postDataHelper = $postDataHelper;
55
}
56
60
public
function
getHref
()
61
{
62
return
$this->
isLoggedIn
()
63
? $this->_customerUrl->getLogoutUrl()
64
: $this->_customerUrl->getLoginUrl();
65
}
66
70
public
function
getLabel
()
71
{
72
return
$this->
isLoggedIn
() ?
__
(
'Sign Out'
) :
__
(
'Sign In'
);
73
}
74
80
public
function
getPostParams
()
81
{
82
return
$this->_postDataHelper->getPostData($this->
getHref
());
83
}
84
90
public
function
isLoggedIn
()
91
{
92
return
$this->httpContext->getValue(
Context::CONTEXT_AUTH
);
93
}
94
99
public
function
getSortOrder
()
100
{
101
return
$this->
getData
(self::SORT_ORDER);
102
}
103
}
Magento\Customer\Block\Account\AuthorizationLink
Definition:
AuthorizationLink.php:18
Magento\Customer\Model\Url
Definition:
Url.php:17
Magento\Framework\App
Magento\Framework\DataObject\getData
getData($key='', $index=null)
Definition:
DataObject.php:119
Magento\Customer\Block\Account\AuthorizationLink\getPostParams
getPostParams()
Definition:
AuthorizationLink.php:80
Magento\Customer\Block\Account\AuthorizationLink\__construct
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\App\Http\Context $httpContext, \Magento\Customer\Model\Url $customerUrl, \Magento\Framework\Data\Helper\PostHelper $postDataHelper, array $data=[])
Definition:
AuthorizationLink.php:44
$customerUrl
$customerUrl
Definition:
info.phtml:28
Magento\Customer\Block\Account\Customer
Definition:
Customer.php:14
Magento\Customer\Block\Account\AuthorizationLink\isLoggedIn
isLoggedIn()
Definition:
AuthorizationLink.php:90
__
__()
Definition:
__.php:13
Magento\Customer\Block\Account\AuthorizationLink\$_postDataHelper
$_postDataHelper
Definition:
AuthorizationLink.php:35
Magento\Customer\Block\Account\AuthorizationLink\getHref
getHref()
Definition:
AuthorizationLink.php:60
Magento\Framework\View\Element\Template\Context
Definition:
Context.php:23
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Customer\Model\Context\CONTEXT_AUTH
const CONTEXT_AUTH
Definition:
Context.php:18
Magento\Customer\Block\Account
Magento
Magento\Framework\View\Element\Html\Link
Definition:
Link.php:17
Magento\Framework\View\Element\Template
Definition:
Template.php:32
Magento\Customer\Block\Account\AuthorizationLink\$_customerUrl
$_customerUrl
Definition:
AuthorizationLink.php:30
Magento\Customer\Block\Account\AuthorizationLink\$httpContext
$httpContext
Definition:
AuthorizationLink.php:25
Magento\Customer\Model\Context
Definition:
Context.php:8
Magento\Customer\Block\Account\AuthorizationLink\getLabel
getLabel()
Definition:
AuthorizationLink.php:70
Magento\Customer\Block\Account\SortLinkInterface
Definition:
SortLinkInterface.php:14
Magento\Customer\Block\Account\AuthorizationLink\getSortOrder
getSortOrder()
Definition:
AuthorizationLink.php:99