yii2-netdisk/models/ZipForm.php
Chenx221 a8902fd449
batch-zip-btn功能实现
今天写的有点多了
有点烦躁起来了
2024-02-15 18:37:06 +08:00

30 lines
655 B
PHP

<?php
namespace app\models;
use yii\base\Model;
class ZipForm extends Model
{
public $zipFilename;
public $zipFormat;
public function rules()
{
return [
[['zipFilename', 'zipFormat'], 'required'],
['zipFilename', 'string', 'max' => 255],
['zipFormat', 'in', 'range' => ['zip', '7z']],
['zipFilename', 'match', 'pattern' => '/^[^\p{C}\/:*?"<>|\\\\]+$/u', 'message' => 'Invalid file name.'],
];
}
public function attributeLabels()
{
return [
'zipFilename' => '压缩文件名',
'zipFormat' => '压缩格式',
];
}
}