20 lines
375 B
PHP
20 lines
375 B
PHP
<?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.'],
|
|
];
|
|
}
|
|
} |