• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
$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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.