lib/Ajde/Crud/Field/Numeric.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

class Ajde_Crud_Field_Numeric extends Ajde_Crud_Field
{
    protected function _getHtmlAttributes()
    {
        $attributes = [];
        $attributes['type'] = 'number';
        $attributes['step'] = 'any';
        $attributes['value'] = Ajde_Component_String::escape($this->getValue());
        $attributes['maxlength'] = $this->getLength();
        if ($this->getIsAutoIncrement() === true || ($this->hasReadonly() && $this->getReadonly() === true)) {
            $attributes['readonly'] = 'readonly';
        }

        return $attributes;
    }
}