CodeIgniter Forums
setRules - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forum-30.html)
+--- Thread: setRules (/thread-71375.html)



setRules - foxbille - 08-07-2018

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