Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Products.php
Go to the documentation of this file.
1 <?php
9 
11 
13 {
17  protected $_customerSession;
18 
23  public function __construct(
24  \Magento\Framework\App\Action\Context $context,
25  \Magento\Customer\Model\Session $customerSession
26  ) {
27  $this->_customerSession = $customerSession;
28  parent::__construct($context);
29  }
30 
38  {
39  $loginUrl = $this->_objectManager->get(\Magento\Customer\Model\Url::class)->getLoginUrl();
40 
41  if (!$this->_customerSession->authenticate($loginUrl)) {
42  $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true);
43  }
44  return parent::dispatch($request);
45  }
46 
52  public function execute()
53  {
54  $this->_view->loadLayout();
55  if ($block = $this->_view->getLayout()->getBlock('downloadable_customer_products_list')) {
56  $block->setRefererUrl($this->_redirect->getRefererUrl());
57  }
58  $this->_view->getPage()->getConfig()->getTitle()->set(__('My Downloadable Products'));
59  $this->_view->renderLayout();
60  }
61 }
_redirect($path, $arguments=[])
Definition: Action.php:167
__()
Definition: __.php:13
$block
Definition: block.php:8
__construct(\Magento\Framework\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession)
Definition: Products.php:23