<?php

namespace GriffinForms\Admin\Html\FormControls;

class InputText extends \GriffinForms\Admin\Html\FormControls\Format
{   
    protected function setCssClass()
    {
        if (!empty($this->data['app_context'])) {
            $this->css_class = 'class="form-control gf-app-control-input griffinforms-' . $this->purgeString($this->name) . ' griffinforms-' . strtolower($this->meta) . ' griffinforms-formcontrol"';
        }
    }

    public function html()
    {
        echo '<input type="text" ' . wp_kses_post($this->attr_name) . ' ';
        $this->getAttr('css_class');
        $this->getAttr('css_id');
        echo 'value="' . esc_html($this->value) . '">';

    }
}
