Skip to content

Get static block content by identifier in helper class?

I am trying to get the content of a static block in a helper class. So far I had no luck. So, how can I get the content of a static block by block identifier in a helper class?

I tried:

$valueContent = $this->getLayout()->createBlock('MagentoCmsBlockBlock')->setBlockId('my_identifier')->toHtml();

Magento 2.2.2