0
Я использую codeigniter rest server. Я не могу проверять параметры запроса GET. это мой код проверки:как проверять запросы на сервере покоя codeigniter?
$username = $this->get('username');
$password = $this->get('password');
$config = [
[
'field' => 'username',
'label' => 'Username',
'rules' => 'required|min_length[3]|alpha_dash',
'errors' => [
'required' => 'We need both username and password',
'min_length'=>'Minimum Username length is 3 characters',
'alpha_dash'=>'You can just use a-z 0-9 _ . – characters for input',
],
],
[
'field' => 'password',
'label' => 'Password',
'rules' => 'required|min_length[6]',
'errors' => [
'required' => 'You must provide a Password.',
'min_length'=>'Minimum Password length is 6 characters',
],
],
];
$this->form_validation->set_data($config);
if($this->form_validation->run()==FALSE){
print_r($this->form_validation->error_array());
echo "ERRR!!";
}
else{
echo "SUCCESS!!";
}
выход:
Array () ERRR!!