Files
piratepoet/lib/Form/Block/Text.php
Jan Jakeš 54549ff037 Convert variable names to camel case
[MAILPOET-1796]
2020-01-14 15:22:42 +01:00

42 lines
879 B
PHP

<?php
namespace MailPoet\Form\Block;
class Text extends Base {
public static function render($block) {
$type = 'text';
$automationId = ' ';
if ($block['id'] === 'email') {
$type = 'email';
$automationId = 'data-automation-id="form_email" ';
}
$html = '<p class="mailpoet_paragraph">';
$html .= static::renderLabel($block);
$html .= '<input type="' . $type . '" class="mailpoet_text" ';
$html .= 'name="data[' . static::getFieldName($block) . ']" ';
$html .= 'title="' . static::getFieldLabel($block) . '" ';
$html .= 'value="' . static::getFieldValue($block) . '" ';
$html .= $automationId;
$html .= static::renderInputPlaceholder($block);
$html .= static::getInputValidation($block);
$html .= static::getInputModifiers($block);
$html .= '/>';
$html .= '</p>';
return $html;
}
}