<?php

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

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

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

        echo '<textarea id="' . esc_attr($control_id) . '" class="form-control" rows="6"' . $attributes . '></textarea>';
    }
}
