Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Footer.php
Go to the documentation of this file.
1 <?php
7 
9 
16 class Footer extends \Magento\Framework\View\Element\Template implements \Magento\Framework\DataObject\IdentityInterface
17 {
23  protected $_copyright;
24 
30  private $miscellaneousHtml;
31 
35  protected $httpContext;
36 
42  public function __construct(
43  \Magento\Framework\View\Element\Template\Context $context,
44  \Magento\Framework\App\Http\Context $httpContext,
45  array $data = []
46  ) {
47  $this->httpContext = $httpContext;
48  parent::__construct($context, $data);
49  }
50 
56  protected function _construct()
57  {
58  $this->addData(
59  [
60  'cache_tags' => [\Magento\Store\Model\Store::CACHE_TAG, \Magento\Cms\Model\Block::CACHE_TAG],
61  ]
62  );
63  }
64 
70  public function getCacheKeyInfo()
71  {
72  return [
73  'PAGE_FOOTER',
74  $this->_storeManager->getStore()->getId(),
75  (int)$this->_storeManager->getStore()->isCurrentlySecure(),
76  $this->_design->getDesignTheme()->getId(),
77  $this->httpContext->getValue(Context::CONTEXT_AUTH),
78  $this->getTemplateFile(),
79  'template' => $this->getTemplate()
80  ];
81  }
82 
88  public function getCopyright()
89  {
90  if (!$this->_copyright) {
91  $this->_copyright = $this->_scopeConfig->getValue(
92  'design/footer/copyright',
93  \Magento\Store\Model\ScopeInterface::SCOPE_STORE
94  );
95  }
96  return __($this->_copyright);
97  }
98 
105  public function getMiscellaneousHtml()
106  {
107  if ($this->miscellaneousHtml === null) {
108  $this->miscellaneousHtml = $this->_scopeConfig->getValue(
109  'design/footer/absolute_footer',
110  \Magento\Store\Model\ScopeInterface::SCOPE_STORE
111  );
112  }
113  return $this->miscellaneousHtml;
114  }
115 
121  public function getIdentities()
122  {
124  }
125 
132  protected function getCacheLifetime()
133  {
134  return parent::getCacheLifetime() ?: 3600;
135  }
136 }
__()
Definition: __.php:13