model for 重命名提交信息验证

This commit is contained in:
Chenx221 2024-02-11 16:02:37 +08:00
parent 0f7c48ef77
commit a80594bcb0
Signed by: chenx221
GPG Key ID: D7A9EC07024C3021

20
models/RenameForm.php Normal file
View File

@ -0,0 +1,20 @@
<?php
namespace app\models;
use yii\base\Model;
class RenameForm extends Model
{
public $newName;
public function rules()
{
return [
['newName', 'required'],
['newName', 'string', 'max' => 255],
['newName', 'match', 'pattern' => '/^[^\/:*?"<>|\\\\]+$/', 'message' => 'Invalid file name.'],
];
}
}