_from.php中
use backend\widgets\ActiveForm;
<?= $form->field($model, 'url')->imgInput(['style' => 'max-width:200px;max-height:200px']);?>model 规则
[['url'], 'file', 'skipOnEmpty' => true, 'extensions' => 'png, jpg, gif'],(或者不写)
_from.php中
use backend\widgets\ActiveForm;
<?= $form->field($model, 'url')->imgInput(['style' => 'max-width:200px;max-height:200px']);?>model 规则
[['url'], 'file', 'skipOnEmpty' => true, 'extensions' => 'png, jpg, gif'],(或者不写)