<?php

namespace Internetgalerie\IgDatapoolFe\ViewHelpers\Form;

use Internetgalerie\IgCoreViewhelpers\ViewHelpers\Form\TextfieldViewHelper;

/**
 * Renders a number text field
 *
 */
class NumberViewHelper extends TextfieldViewHelper
{

    public function initializeArguments(): void
    {
        parent::initializeArguments();
        $this->registerTagAttribute('min', 'int', 'min', false);
        $this->registerTagAttribute('max', 'int', 'max', false);
        $this->registerTagAttribute('step', 'int', 'step', false);
    }

    public function render(): string
    {
        $this->arguments['type'] = 'number';

        return parent::render();
        //return '<div class="dp-spinner">' . $field . '</div>';
    }
}
