form validation with Parsley

This commit is contained in:
Jonathan Labreuille
2015-11-06 12:28:24 +01:00
parent cfdb886e88
commit 31305a04c0
13 changed files with 166 additions and 237 deletions

View File

@ -4,13 +4,18 @@ namespace MailPoet\Form\Block;
class Input 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="text" class="mailpoet_input" ';
$html .= '<input type="'.$type.'" class="mailpoet_input" ';
$html .= 'name="'.static::getFieldName($block).'" ';