• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] CodeIgniter4 User Guide - tutorial

#1
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 ?
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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