yii2-netdisk/models/RenameForm.php

20 lines
375 B
PHP
Raw Normal View History

2024-02-11 16:02:37 +08:00
<?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' => '/^[^\p{C}\/:*?"<>|\\\\]+$/u', 'message' => 'Invalid file name.'],
2024-02-11 16:02:37 +08:00
];
}
}