2016-08-05 14:38:19 3182次浏览 2条回答 1 悬赏 10 金钱

页面上有 username1 和 username2 两个 input 框,当用户提交数据时,要验证 username1 和username2 不能全为空,我该怎么验证?

最佳答案

  • 回答于 2016-08-05 16:17 举报
    public function rules()
    {
        return [      
            ['username1', 'required',, 'message' => '不能为空'],
            ['username2', 'required',, 'message' => '不能为空']   
        ];
    }
    
您需要登录后才可以回答。登录 | 立即注册
YiiSoEasy
CEO

YiiSoEasy 中国

注册时间:2014-11-25
最后登录:2024-03-25
在线时长:188小时51分
  • 粉丝209
  • 金钱10942
  • 威望120
  • 积分14022

热门问题