驗證層,用于驗證請求參數,同TP5.1[驗證器](http://www.hmoore.net/manual/thinkphp5_1/354102)。
但由于鉤子的存在,驗證器的場景屬性,需提供您的方法名。
比如您的訪問路徑`index/index/edit`,需要驗證name與age的參數。
則需要添加Index模塊的validate層,在validate中添加`IndexValidate`類,并繼承`think\Validate`類,并在類中添加相應rule與message屬性,而場景屬性需要按如下提供。
> 場景名需完全按照方法名來填寫。
```php
protected $scene = [
'edit' => ['name','age'],
];
```