CodeIgniter Forums
[split] CodeIgniter4 User Guide - tutorial - 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: [split] CodeIgniter4 User Guide - tutorial (/thread-71393.html)



[split] CodeIgniter4 User Guide - tutorial - foxbille - 08-09-2018

Hello,
I'm reading this guide, trying tutorial samples and with "Create new item", i got an error with this controller code

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

   if (! $this->validate($this->request, [
       'title' => 'required|min[3]|max[255]',
       'text'  => 'required'
   ]))
   {

validate function DOES NOT need $this->request, but waits for $rules and $messages

according to me, sample code should be 
if (! $this->validate([
       'title' => 'required|min[3]|max[255]',
       'text'  => 'required'
   ]))
   {


Am I right ?