Actually, this is not related to specifically to Zend_Dojo_Form_Element_NumberTextBox but to Zend_Dojo_Form_Element_ValidationTextBox
To describe more closely the issue, a few examples:
$this->addElement(
'NumberTextBox',
'number',
array(
'label' => 'Number',
'constraints' => array(
'places' => '6'
),
'pattern' => '0.######',
'locale' => 'en'
)
);
Will generate the the constraints, as expected, for "places", "pattern" and "locale".
But, on the other hand:
$this->addElement(
'NumberTextBox',
'number',
array(
'label' => 'Number',
'pattern' => '0.######',
'locale' => 'en',
'constraints' => array(
'places' => '6'
)
)
);
will generate constraints only for the "places".
Even if the method name is setConstraints, what it is actually doing is adding constraints, so the second example should generate the same result as the first one.
Actually, this is not related to specifically to Zend_Dojo_Form_Element_NumberTextBox but to Zend_Dojo_Form_Element_ValidationTextBox
To describe more closely the issue, a few examples:
Will generate the the constraints, as expected, for "places", "pattern" and "locale".
But, on the other hand:
will generate constraints only for the "places".
Even if the method name is setConstraints, what it is actually doing is adding constraints, so the second example should generate the same result as the first one.