File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ Yii Framework 2 Change Log
8
8
- Bug #16116 : Codeception: oci does not support enabling/disabling integrity check (@terabytesoftw )
9
9
- Bug #20191 : Fix ` ActiveRecord::getDirtyAttributes() ` for JSON columns with multi-dimensional array values (brandonkelly)
10
10
- Bug #20175 : Fix bad result for pagination when used with GridView (@lav45 )
11
+ - Bug #20211 : Add acceptable parameters to ` MaskedInput::init() ` method (alxlnk)
11
12
12
13
13
14
2.0.50 May 30, 2024
Original file line number Diff line number Diff line change @@ -132,8 +132,8 @@ class MaskedInput extends InputWidget
132
132
public function init ()
133
133
{
134
134
parent ::init ();
135
- if (empty ($ this ->mask ) && empty ($ this ->clientOptions ['alias ' ])) {
136
- throw new InvalidConfigException ("Either the 'mask' property or the 'clientOptions[ \"alias \"]' property must be set. " );
135
+ if (empty ($ this ->mask ) && empty ($ this ->clientOptions ['regex ' ]) && empty ( $ this -> clientOptions [ ' alias ' ])) {
136
+ throw new InvalidConfigException ("Either the 'mask' property, 'clientOptions[ \" regex \" ]' or the 'clientOptions[ \"alias \"]' property must be set. " );
137
137
}
138
138
}
139
139
Original file line number Diff line number Diff line change @@ -677,6 +677,13 @@ public function testInputOptionsTransferToWidget()
677
677
]);
678
678
$ this ->assertStringContainsString ('placeholder="pholder_direct" ' , (string ) $ widget );
679
679
680
+ // use regex clientOptions instead mask
681
+ $ widget = $ this ->activeField ->widget (TestMaskedInput::className (), [
682
+ 'options ' => ['placeholder ' => 'pholder_direct ' ],
683
+ 'clientOptions ' => ['regex ' => '^.*$ ' ],
684
+ ]);
685
+ $ this ->assertStringContainsString ('placeholder="pholder_direct" ' , (string ) $ widget );
686
+
680
687
// transfer options from ActiveField to widget
681
688
$ this ->activeField ->inputOptions = ['placeholder ' => 'pholder_input ' ];
682
689
$ widget = $ this ->activeField ->widget (TestMaskedInput::className (), [
You can’t perform that action at this time.
0 commit comments