<?php

namespace GriffinForms\Admin\App\Html\Widgets\PresentationArea\FormControls;

class InputPassword extends \GriffinForms\Admin\App\Html\Widgets\PresentationArea\FormControls\Format
{
    public function getHtml()
    {
        $this->renderFieldStyles(array('text_input'));

        $control_id = $this->getFieldControlId('password');
        $attributes = $this->getFieldStyleAttributes('text_input');
        $placeholder = $this->getFieldPlaceholder();
        if ($placeholder !== '') {
            $attributes .= ' placeholder="' . esc_attr($placeholder) . '"';
        }

        echo '<input type="password" id="' . esc_attr($control_id) . '" class="form-control"' . $attributes . '>';
    }
}
