12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- /**
- * Copyright © 2015 Ihor Vansach (ihor@magefan.com). All rights reserved.
- * See LICENSE.txt for license details (http://opensource.org/licenses/osl-3.0.php).
- *
- * Glory to Ukraine! Glory to the heroes!
- */
- namespace Magefan\Blog\Block;
- /**
- * Class Link
- */
- class Link extends \Magento\Framework\View\Element\Html\Link
- {
- /**
- * @var \Magefan\Blog\Model\Url
- */
- protected $_url;
- /**
- * @param \Magento\Framework\View\Element\Template\Context $context
- * @param \Magefan\Blog\Model\Url $url
- * @param array $data
- */
- public function __construct(
- \Magento\Framework\View\Element\Template\Context $context,
- \Magefan\Blog\Model\Url $url,
- array $data = []
- ) {
- $this->_url = $url;
- parent::__construct($context, $data);
- }
- /**
- * @return string
- */
- public function getHref()
- {
- return $this->_url->getBaseUrl();
- }
- /**
- * @return string
- */
- public function getLabel()
- {
- return $this->_scopeConfig->getValue(
- 'mfblog/index_page/title',
- \Magento\Store\Model\ScopeInterface::SCOPE_STORE
- );
- }
- /**
- * Render block HTML
- *
- * @return string
- */
- protected function _toHtml()
- {
- if (!$this->_scopeConfig->getValue(
- \Magefan\Blog\Helper\Config::XML_PATH_EXTENSION_ENABLED,
- \Magento\Store\Model\ScopeInterface::SCOPE_STORE
- )) {
- return '';
- }
- return parent::_toHtml();
- }
- }
|