<?php namespace MailPoet\Form\Block; if (!defined('ABSPATH')) exit; class Html { /** @var BlockRendererHelper */ private $rendererHelper; public function __construct( BlockRendererHelper $rendererHelper ) { $this->rendererHelper = $rendererHelper; } public function render(array $block, array $formSettings): string { $html = ''; $text = ''; if (isset($block['params']['text']) && $block['params']['text']) { $text = html_entity_decode($block['params']['text'], ENT_QUOTES); } if (isset($block['params']['nl2br']) && $block['params']['nl2br']) { $text = nl2br($text); } $classes = isset($block['params']['class_name']) ? " " . $block['params']['class_name'] : ''; $html .= '<div class="mailpoet_paragraph' . $classes . '" ' . $this->rendererHelper->renderFontStyle($formSettings) . '>'; $html .= $text; $html .= '</div>'; return $html; } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
BlockRendererHelper.php | File | 6.65 KB | 0644 |
|
Checkbox.php | File | 1.79 KB | 0644 |
|
Column.php | File | 1.85 KB | 0644 |
|
Columns.php | File | 1.81 KB | 0644 |
|
Date.php | File | 7.46 KB | 0644 |
|
Divider.php | File | 1.88 KB | 0644 |
|
Heading.php | File | 2.85 KB | 0644 |
|
Html.php | File | 928 B | 0644 |
|
Image.php | File | 2.88 KB | 0644 |
|
Paragraph.php | File | 2.54 KB | 0644 |
|
Radio.php | File | 2.02 KB | 0644 |
|
Segment.php | File | 2.45 KB | 0644 |
|
Select.php | File | 2.67 KB | 0644 |
|
Submit.php | File | 1.59 KB | 0644 |
|
Text.php | File | 2.26 KB | 0644 |
|
Textarea.php | File | 1.84 KB | 0644 |
|
index.php | File | 0 B | 0644 |
|