getBlockRendererForClass() public method

public getBlockRendererForClass ( string $blockClass ) : League\CommonMark\Block\Renderer\BlockRendererInterface | null
$blockClass string
return League\CommonMark\Block\Renderer\BlockRendererInterface | null
Beispiel #1
0
 /**
  * @param AbstractBlock $block
  * @param bool          $inTightList
  *
  * @throws \RuntimeException
  *
  * @return string
  */
 public function renderBlock(AbstractBlock $block, $inTightList = false)
 {
     $renderer = $this->environment->getBlockRendererForClass(get_class($block));
     if (!$renderer) {
         throw new \RuntimeException('Unable to find corresponding renderer for block type ' . get_class($block));
     }
     return $renderer->render($block, $this, $inTightList);
 }