CodeIgniter Forums
[split] CodeIgniter4 User Guide - tutorial - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: [split] CodeIgniter4 User Guide - tutorial (/showthread.php?tid=71393)



[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 ?