Files
piratepoet/lib/Form/Block/Text.php
Vlad b549f83422 Updates form subscription class to use the main API class instead of calling directly API endpoint
Modifies forms to pass api_version
Modifies forms to pass store form-specific values (e.g., form_id, email) inside a separate data array
2017-04-19 15:38:16 -04:00

40 lines
790 B
PHP

<?php
namespace MailPoet\Form\Block;
if(!defined('ABSPATH')) exit;
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="data['.static::getFieldName($block).']" ';
$html .= 'title="'.static::getFieldLabel($block).'" ';
$html .= 'value="'.static::getFieldValue($block).'" ';
$html .= static::renderInputPlaceholder($block);
$html .= static::getInputValidation($block);
$html .= static::getInputModifiers($block);
$html .= '/>';
$html .= '</p>';
return $html;
}
}