model for 重命名提交信息验证
This commit is contained in:
parent
0f7c48ef77
commit
a80594bcb0
20
models/RenameForm.php
Normal file
20
models/RenameForm.php
Normal 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.'],
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user