CustomFields
- renamed form block type "input" to "text" for consistency with React - updated CustomFields router to comply with main router - unit tests for CF router
This commit is contained in:
36
lib/Form/Block/Text.php
Normal file
36
lib/Form/Block/Text.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
namespace MailPoet\Form\Block;
|
||||
|
||||
class Text extends Base {
|
||||
|
||||
static function render($block) {
|
||||
$type = 'text';
|
||||
if($block['id'] === 'email') {
|
||||
$type = 'email';
|
||||
}
|
||||
|
||||
$html = '';
|
||||
|
||||
$html .= '<p class="mailpoet_paragraph">';
|
||||
|
||||
$html .= static::renderLabel($block);
|
||||
|
||||
$html .= '<input type="'.$type.'" class="mailpoet_text" ';
|
||||
|
||||
$html .= 'name="'.static::getFieldName($block).'" ';
|
||||
|
||||
$html .= 'title="'.static::getFieldLabel($block).'" ';
|
||||
|
||||
$html .= 'value="'.static::getFieldValue($block).'" ';
|
||||
|
||||
$html .= static::renderInputPlaceholder($block);
|
||||
|
||||
$html .= static::getInputValidation($block);
|
||||
|
||||
$html .= '/>';
|
||||
|
||||
$html .= '</p>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user