Validate Verification of tp5

use a custom validation scenario in the controller, but how to use the custom error prompt in the scenario

clipboard.png

Aug.13,2021

    protected $rule =   [
        'name'  => 'require|max:25',
        'age'   => 'number|between:1,120',
        'email' => 'email',    
    ];
    
    protected $message  =   [
        'name.require' => '',
        'name.max'     => '25',
        'age.number'   => '',
        'age.between'  => '1-120',
        'email'        => '',    
    ];
    
    protected $scene = [
        'edit'  =>  ['name','age'],
    ];

tp5.1 https://www.kancloud.cn/manua.
tp5.0 https://www.kancloud.cn/manua.
documents are all written in message.


take a good look at the manual

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3cfdf-2c365.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3cfdf-2c365.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?