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

@ -4,7 +4,7 @@ namespace MailPoet\Form\Block;
class Text extends Base {
public static function render($block) {
public function render($block) {
$type = 'text';
$automationId = ' ';
if ($block['id'] === 'email') {
@ -14,23 +14,23 @@ class Text extends Base {
$html = '<p class="mailpoet_paragraph">';
$html .= static::renderLabel($block);
$html .= $this->renderLabel($block);
$html .= '<input type="' . $type . '" class="mailpoet_text" ';
$html .= 'name="data[' . static::getFieldName($block) . ']" ';
$html .= 'name="data[' . $this->getFieldName($block) . ']" ';
$html .= 'title="' . static::getFieldLabel($block) . '" ';
$html .= 'title="' . $this->getFieldLabel($block) . '" ';
$html .= 'value="' . static::getFieldValue($block) . '" ';
$html .= 'value="' . $this->getFieldValue($block) . '" ';
$html .= $automationId;
$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 .= '/>';