Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Share.php
Go to the documentation of this file.
1 <?php
7 
10 
12 {
16  protected $customerSession;
17 
22  public function __construct(
23  \Magento\Framework\App\Action\Context $context,
24  \Magento\Customer\Model\Session $customerSession
25  ) {
26  $this->customerSession = $customerSession;
27  parent::__construct($context);
28  }
29 
35  public function execute()
36  {
37  if ($this->customerSession->authenticate()) {
39  $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
40  return $resultPage;
41  }
42  }
43 }
__construct(\Magento\Framework\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession)
Definition: Share.php:22