Add block renderers to DI container

[MAILPOET-2665]
This commit is contained in:
Rostislav Wolny
2020-01-29 17:05:36 +01:00
committed by Jack Kitterhing
parent d9b9e13a04
commit 6827eb93e6
14 changed files with 169 additions and 85 deletions

View File

@@ -3,26 +3,26 @@
namespace MailPoet\Form\Block;
class Textarea extends Base {
public static function render($block) {
public function render($block) {
$html = '';
$html .= '<p class="mailpoet_paragraph">';
$html .= static::renderLabel($block);
$html .= $this->renderLabel($block);
$lines = (isset($block['params']['lines']) ? (int)$block['params']['lines'] : 1);
$html .= '<textarea class="mailpoet_textarea" rows="' . $lines . '" ';
$html .= 'name="data[' . static::getFieldName($block) . ']"';
$html .= 'name="data[' . $this->getFieldName($block) . ']"';
$html .= static::renderInputPlaceholder($block);
$html .= $this->renderInputPlaceholder($block);
$html .= static::getInputValidation($block);
$html .= $this->getInputValidation($block);
$html .= static::getInputModifiers($block);
$html .= $this->getInputModifiers($block);
$html .= '>' . static::getFieldValue($block) . '</textarea>';
$html .= '>' . $this->getFieldValue($block) . '</textarea>';
$html .= '</p>';