在相应的控制器中开启

class Staff extends Backend
{
    protected $modelValidate = true;  //开启验证规则
    protected $modelSceneValidate = true;  //开启验证场景

    /**
     * Staff模型对象
     * @var \app\admin\model\Staff
     */
    protected $model = null;

    public function _initialize()
    {
        parent::_initialize();
        $this->model = new \app\admin\model\Staff;
        // $this->modelValidate = new ValidateStaff();
    }

 

相关文章:

  • 2022-01-17
  • 2022-02-23
  • 2021-10-16
  • 2021-07-30
  • 2021-10-01
  • 2021-03-31
  • 2022-12-23
猜你喜欢
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案