vendor/bitbag/cms-plugin/src/Twig/Runtime/RenderContentRuntime.php line 26

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file was created by developers working at BitBag
  4.  * Do you need more information about us and what we do? Visit our https://bitbag.io website!
  5.  * We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
  6. */
  7. declare(strict_types=1);
  8. namespace BitBag\SyliusCmsPlugin\Twig\Runtime;
  9. use BitBag\SyliusCmsPlugin\Entity\ContentableInterface;
  10. use BitBag\SyliusCmsPlugin\Twig\Parser\ContentParserInterface;
  11. final class RenderContentRuntime implements RenderContentRuntimeInterface
  12. {
  13.     /** @var ContentParserInterface */
  14.     private $contentParser;
  15.     public function __construct(ContentParserInterface $contentParser)
  16.     {
  17.         $this->contentParser $contentParser;
  18.     }
  19.     public function renderContent(ContentableInterface $contentableResource): string
  20.     {
  21.         $content html_entity_decode((string) $contentableResource->getContent(), \ENT_QUOTES);
  22.         return $this->contentParser->parse($content);
  23.     }
  24. }