Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Header.php
Go to the documentation of this file.
1 <?php
8 
17 {
21  protected $_template = 'Magento_Backend::page/header.phtml';
22 
28  protected $_backendData = null;
29 
33  protected $_authSession;
34 
41  public function __construct(
42  \Magento\Backend\Block\Template\Context $context,
43  \Magento\Backend\Model\Auth\Session $authSession,
44  \Magento\Backend\Helper\Data $backendData,
45  array $data = []
46  ) {
47  $this->_backendData = $backendData;
48  $this->_authSession = $authSession;
49  parent::__construct($context, $data);
50  }
51 
55  public function getHomeLink()
56  {
57  return $this->_backendData->getHomePageUrl();
58  }
59 
63  public function getUser()
64  {
65  return $this->_authSession->getUser();
66  }
67 
71  public function getLogoutLink()
72  {
73  return $this->getUrl('adminhtml/auth/logout');
74  }
75 
81  public function displayNoscriptNotice()
82  {
83  return $this->_scopeConfig->getValue(
84  'web/browser_capabilities/javascript',
85  \Magento\Store\Model\ScopeInterface::SCOPE_STORE
86  );
87  }
88 }
__construct(\Magento\Backend\Block\Template\Context $context, \Magento\Backend\Model\Auth\Session $authSession, \Magento\Backend\Helper\Data $backendData, array $data=[])
Definition: Header.php:41