![]() |
CI version 4.1.1 Call to a member function setRules() on null - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10) +--- Thread: CI version 4.1.1 Call to a member function setRules() on null (/showthread.php?tid=78769) |
CI version 4.1.1 Call to a member function setRules() on null - lnavarro - 03-08-2021 Hi all, im having this problem using validations, on my production server here is my controller code PHP Code: <?php here my model code PHP Code: ?php namespace App\Models; my html form code Code: <form action="registrar" method="POST" accept-charset="UTF-8" onsubmit="registerButton.disabled = true; return true;"> I have search in this forum, but nothing found pd: sorry for my bad english ![]() RE: CI version 4.1.1 Call to a member function setRules() on null - iRedds - 03-08-2021 Is this the complete model code? I am asking because it seems to me that you have override the constructor in your model. RE: CI version 4.1.1 Call to a member function setRules() on null - lnavarro - 03-09-2021 (03-08-2021, 10:46 AM)iRedds Wrote: Is this the complete model code? thank for responce.....yes, this is my complete model code RE: CI version 4.1.1 Call to a member function setRules() on null - paulbalandan - 03-09-2021 Can you show the complete error stack? RE: CI version 4.1.1 Call to a member function setRules() on null - lnavarro - 03-09-2021 (03-09-2021, 11:20 AM)paulbalandan Wrote: Can you show the complete error stack? there is some screen shot RE: CI version 4.1.1 Call to a member function setRules() on null - iRedds - 03-09-2021 The value of the validation property is initially undefined. Only in the constructor is it assigned an instance of the validation class. An error means that either the constructor in the BaseModel class is not called (overridden in the inheritors), or the property value is reset. RE: CI version 4.1.1 Call to a member function setRules() on null - paulbalandan - 03-10-2021 @iRedds is right. The validation property was not initialized with the Validation instance. In your controller code, right after instantiating UsersAuthModel to $users, can you do a dump using dd()? dd($users); |