Last active
September 10, 2020 20:34
-
-
Save andrewdaluz/1175dfe6e5ee5ea3631b7358c62b7131 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Vendor\Module\Helper; | |
class Data extends \Magento\Framework\App\Helper\AbstractHelper | |
{ | |
/** | |
* @var \Magento\Framework\View\LayoutInterface | |
*/ | |
protected $layout; | |
/** | |
* Data constructor. | |
* @param \Magento\Framework\App\Helper\Context $context | |
* @param \Magento\Framework\View\LayoutInterface $layout | |
*/ | |
public function __construct( | |
\Magento\Framework\App\Helper\Context $context, | |
\Magento\Framework\View\LayoutInterface $layout | |
) { | |
$this->layout = $layout; | |
parent::__construct($context); | |
} | |
/** | |
* @return block $valueContent | |
*/ | |
public function getBlock() { | |
$valueContent = $this->layout | |
->createBlock('Magento\Cms\Block\Block') | |
->setBlockId('my_identifier') | |
->toHtml(); | |
return $valueContent; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment