Welcome Guest, Not a member yet? Register   Sign In
Search Results
    Thread: Custom Validation Rule in Model
Post: RE: Custom Validation Rule in Model

iRedds Wrote: (01-22-2021, 09:24 PM) -- josh2112o Wrote: (01-22-2021, 05:54 PM) -- Hi, Thanks for the links... So I have this code in my model for validation: PHP Code: -- protected $validationR...
874 Views
6 Replies
01-23-2021, 03:16 AM
josh2112o
    Thread: Custom Validation Rule in Model
Post: RE: Custom Validation Rule in Model

iRedds Wrote: (01-22-2021, 05:26 PM) -- josh2112o Wrote: (01-22-2021, 04:08 PM) -- I was hoping to use the validation functionality in the model itself instead of the Controller. I have written some...
874 Views
6 Replies
01-22-2021, 05:54 PM
josh2112o
    Thread: Custom Validation Rule in Model
Post: RE: Custom Validation Rule in Model

iRedds Wrote: (01-22-2021, 02:23 PM) -- I didn't fully understand your problem. You can override the validate() method of the model to include your library. Or add a method with your library to th...
874 Views
6 Replies
01-22-2021, 04:08 PM
josh2112o
    Thread: Custom Validation Rule in Model
Post: Custom Validation Rule in Model

I know we can have custom validation rules in the controller, by adding more rule sets to the /Config/Validation.php file but how do we add them to the model when performing validation there. Somethi...
874 Views
6 Replies
01-22-2021, 03:28 AM
josh2112o
    Thread: Validation in the Model not working
Post: RE: Validation in the Model not working

neoneeco Wrote: (01-18-2021, 11:06 AM) -- Sorry i dont really understand, Do you mean that the error is here : protected $table      = 'walking_stats'; protected $primaryKey = 'day_walked'; prot...
913 Views
6 Replies
01-18-2021, 02:18 PM
josh2112o
    Thread: Validation in the Model not working
Post: RE: Validation in the Model not working

iRedds Wrote: (01-17-2021, 11:32 AM) -- josh2112o Wrote: (01-17-2021, 06:13 AM) -- Hi all, I am trying to perform data validation in my Model class, following along with the instruction/practices m...
913 Views
6 Replies
01-17-2021, 11:41 AM
josh2112o
    Thread: Validation in the Model not working
Post: RE: Validation in the Model not working

Corsari Wrote: (01-17-2021, 08:55 AM) -- Hello friends I have found the solution The problem for me was to make the right use of alias for columns Easy task for experienced coders ... but I'...
913 Views
6 Replies
01-17-2021, 10:57 AM
josh2112o
    Thread: Validation in the Model not working
Post: Validation in the Model not working

Hi all, I am trying to perform data validation in my Model class, following along with the instruction/practices mentioned in the docs here (https://codeigniter4.github.io/userguide/models/model.html...
913 Views
6 Replies
01-17-2021, 06:13 AM
josh2112o
    Thread: CodeIgniter 4 Model Callbacks not hashing password before insert
Post: RE: CodeIgniter 4 Model Callbacks not hashing pass...

InsiteFX Wrote: (01-02-2021, 09:45 PM) -- Also keep in mind that password_hash is expecting a string parameter, may cause problems passing arrays. -- Thank you for the information and best practices ...
950 Views
7 Replies
01-03-2021, 06:49 AM
josh2112o
    Thread: CodeIgniter 4 Model Callbacks not hashing password before insert
Post: RE: CodeIgniter 4 Model Callbacks not hashing pass...

iRedds Wrote: (01-02-2021, 09:24 PM) -- josh2112o Wrote: (01-02-2021, 11:15 AM) -- Hi and thanks for the response. So, when you say the event triggers need to be called manually, does that mean I ne...
950 Views
7 Replies
01-03-2021, 06:47 AM
josh2112o
    Thread: CodeIgniter 4 Model Callbacks not hashing password before insert
Post: RE: CodeIgniter 4 Model Callbacks not hashing pass...

iRedds Wrote: (01-02-2021, 09:41 AM) -- At first, the $allowCallbacks model property is enabled by default.  For events to work, you need to use defined methods like insert / update / save / etc. ...
950 Views
7 Replies
01-02-2021, 11:15 AM
josh2112o
    Thread: CodeIgniter 4 Model Callbacks not hashing password before insert
Post: CodeIgniter 4 Model Callbacks not hashing password...

Hi, I am totally new to CI4 but do have some experience with PHP. I having trouble getting the Model class callback functions to work when inserting a new user row. Here is the Controller: Code: -...
950 Views
7 Replies
01-02-2021, 06:56 AM
josh2112o

Theme © iAndrew 2016 - Forum software by © MyBB