Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Customer.php
Go to the documentation of this file.
1 <?php
7 
9 
15 {
20 
24  protected $_viewHelper;
25 
29  protected $httpContext;
30 
36  public function __construct(
37  \Magento\Framework\View\Element\Template\Context $context,
38  \Magento\Framework\App\Http\Context $httpContext,
39  array $data = []
40  ) {
41  parent::__construct($context, $data);
42  $this->httpContext = $httpContext;
43  }
44 
50  public function customerLoggedIn()
51  {
52  return (bool)$this->httpContext->getValue(\Magento\Customer\Model\Context::CONTEXT_AUTH);
53  }
54 }
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\App\Http\Context $httpContext, array $data=[])
Definition: Customer.php:36