Skip to content

i18n validators used outside suggested laminas-form view helpers #152

@gisostallenberg

Description

@gisostallenberg

Bug Report

Q A
Version(s) 3.0.1

Summary

The package suggests to require laminas/laminas-i18n with the following notice ^2.11, required when using laminas-form view helpers, but when using a Range Element the getValidators method instantiates a new Laminas\I18n\Validator\IsFloat.

Current behavior

How to reproduce

Make sure the suggested package is not installed:

composer remove laminas/laminas-i18n

Run this code:

        $form = (new \Laminas\Form\Form())->add(
            (new \Laminas\Form\Element\Range('range'))
                ->setAttributes(['min' => 1, 'max' => 10])
        );
        $form->getInputFilter(); // Class \"Laminas\\I18n\\Validator\\IsFloat\" not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions