Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Info.php
Go to the documentation of this file.
1 <?php
7 
15 {
19  protected $_customerUrl;
20 
26  protected $checkoutData;
27 
33  protected $coreUrl;
34 
40  protected $registration;
41 
50  public function __construct(
51  \Magento\Framework\View\Element\Template\Context $context,
52  \Magento\Customer\Model\Registration $registration,
53  \Magento\Customer\Model\Url $customerUrl,
54  \Magento\Checkout\Helper\Data $checkoutData,
55  \Magento\Framework\Url\Helper\Data $coreUrl,
56  array $data = []
57  ) {
58  parent::__construct($context, $data);
59  $this->registration = $registration;
60  $this->_customerUrl = $customerUrl;
61  $this->checkoutData = $checkoutData;
62  $this->coreUrl = $coreUrl;
63  }
64 
70  public function getRegistration()
71  {
72  return $this->registration;
73  }
74 
80  public function getCreateAccountUrl()
81  {
82  $url = $this->getData('create_account_url');
83  if ($url === null) {
84  $url = $this->_customerUrl->getRegisterUrl();
85  }
86  if ($this->checkoutData->isContextCheckout()) {
87  $url = $this->coreUrl->addRequestParam($url, ['context' => 'checkout']);
88  }
89  return $url;
90  }
91 }
getData($key='', $index=null)
Definition: DataObject.php:119
$customerUrl
Definition: info.phtml:28
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Customer\Model\Registration $registration, \Magento\Customer\Model\Url $customerUrl, \Magento\Checkout\Helper\Data $checkoutData, \Magento\Framework\Url\Helper\Data $coreUrl, array $data=[])
Definition: Info.php:50