Skip to content

Commit

Permalink
Add regex property to one of required option.
Browse files Browse the repository at this point in the history
  • Loading branch information
alxlnk committed Jun 24, 2024
1 parent fdf1fea commit 06643e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions widgets/MaskedInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ class MaskedInput extends InputWidget
public function init()
{
parent::init();
if (empty($this->mask) && empty($this->clientOptions['alias'])) {
throw new InvalidConfigException("Either the 'mask' property or the 'clientOptions[\"alias\"]' property must be set.");
if (empty($this->mask) && empty($this->clientOptions['regex']) && empty($this->clientOptions['alias'])) {
throw new InvalidConfigException("Either the 'mask' property, 'clientOptions[\"regex\"]' or the 'clientOptions[\"alias\"]' property must be set.");
}
}

Expand Down

0 comments on commit 06643e3

Please sign in to comment.