Files
piratepoet/lib/Newsletter/Renderer/Blocks/Placeholder.php
Jan Lysý 4d5801caa3 Create block placeholder
[MAILPOET-3638]
2021-06-14 09:46:19 +02:00

27 lines
635 B
PHP

<?php declare(strict_types = 1);
namespace MailPoet\Newsletter\Renderer\Blocks;
use MailPoet\WP\Functions as WPFunctions;
class Placeholder {
/** @var WPFunctions */
private $wp;
public function __construct(WPFunctions $wp) {
$this->wp = $wp;
}
public function render($element): string {
$placeholder = $element['placeholder'];
$class = $element['class'] ?? '';
$style = $element['style'] ?? '';
return '
<tr>
<td class="' . $this->wp->escAttr($class) . '" style="' . $this->wp->escAttr($style) . '">
' . $this->wp->escHtml($placeholder) . '
</td>
</tr>';
}
}