Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Link.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Checkout\Block;
7 
14 {
18  protected $_moduleManager;
19 
23  protected $_checkoutHelper;
24 
32  public function __construct(
33  \Magento\Framework\View\Element\Template\Context $context,
34  \Magento\Framework\Module\Manager $moduleManager,
35  \Magento\Checkout\Helper\Data $checkoutHelper,
36  array $data = []
37  ) {
38  $this->_checkoutHelper = $checkoutHelper;
39  parent::__construct($context, $data);
40  $this->_moduleManager = $moduleManager;
41  }
42 
47  public function getHref()
48  {
49  return $this->getUrl('checkout', ['_secure' => true]);
50  }
51 
57  protected function _toHtml()
58  {
59  if (!$this->_checkoutHelper->canOnepageCheckout() || !$this->_moduleManager->isOutputEnabled(
60  'Magento_Checkout'
61  )
62  ) {
63  return '';
64  }
65  return parent::_toHtml();
66  }
67 }
$moduleManager
Definition: products.php:75