CodeIgniter Forums

Full Version: setRules
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I wonder why this exemple taken from tutorial in codeigniter4 user guide,

public function create()
{
    helper('form');
    $model = new NewsModel();

    if (! $this->validate($this->request, [
        'title' => 'required|min[3]|max[255]',
        'text'  => 'required'
    ]))
    {
 
makes an error :
Argument 1 passed to CodeIgniter\Validation\Validation:ConfusedetRules() must be of the type array, object given, called in ...

Thanks for your help