diff --git a/common/models/Team.php b/common/models/Team.php index eab42bd..32b55ff 100644 --- a/common/models/Team.php +++ b/common/models/Team.php @@ -107,6 +107,11 @@ 'default', 'value' => '', ], + [ + ['link'], + 'match', + 'pattern' => '/^(?:https?:\/\/)?(?:w{3}\.)?'.preg_quote($_SERVER['HTTP_HOST']).'\/performer\/\w+\/\d+$/i', + ] ]; } diff --git a/frontend/views/accounts/_team_form.php b/frontend/views/accounts/_team_form.php index c4fce0a..ad9d7b8 100644 --- a/frontend/views/accounts/_team_form.php +++ b/frontend/views/accounts/_team_form.php @@ -9,6 +9,7 @@ use common\modules\file\widgets\ImageUploader; use kartik\select2\Select2; use yii\helpers\Html; + use yii\helpers\Url; use yii\web\JsExpression; use yii\widgets\ActiveForm; @@ -43,6 +44,13 @@ +
+
+ field($team, 'link') + ->hint('Пример: ' . $_SERVER[ 'HTTP_HOST' ] . '/performer/common/1') + ->textInput([ 'class' => 'custom-input-2' ]) ?> +
+
-- libgit2 0.21.4