Answer the question
In order to leave comments, you need to log in
Yii\validators\UrlValidator without http and https?
How to forbid to enter the name of the protocol? Tried like this
['url', \yii\validators\UrlValidator::className(), 'validSchemes' => []],
http://example.com
and example.com
both are not valid.
Answer the question
In order to leave comments, you need to log in
Decided so
['url', \yii\validators\UrlValidator::className(), 'pattern' => '/^([a-z0-9\.-]{4,})$/i'],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question