Welcome Guest, Not a member yet? Register   Sign In
$this->validate bug?
#1

Code:
<?php namespace App\Controllers;

use CodeIgniter\Controller;

class Login extends Controller
{
    public function index()
    {
        helper('form');
        if (! $this->validate($this->request, []))
            print view('login');
        else
            print "It worked";
    }

    //--------------------------------------------------------------------

}


I get an error:
TypeError
Argument 2 passed to CodeIgniter\Validation\Validation:ConfusedetRules() must be of the type array, null given, called in /Users/satchwinston/Sites/CI4dev/system/Controller.php on line 187


Code:
public function validate(RequestInterface $request, $rules, array $messages = null): bool
183     {


Shouldn't "array $messages = null" be "array $messages = []"?
Simpler is always better
Reply
#2

Looks like a new download of CI4 does not have this problem.
Simpler is always better
Reply




Theme © iAndrew 2016 - Forum software by © MyBB