📜  api codeigniter 中的表单验证输入 - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:57.209000             🧑  作者: Mango

代码示例2
$this->form_validation->set_rules('user_api_key', 'User Api Id', 'trim|required');

if ($this->form_validation->run() == FALSE) {
  $data = strip_tags($this->form_validation->error_string());
  return $this->json_out($data, 0, $code = 'form_validation_error', $msg = 'Some Fields are required');
}