-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore_value should be the value of ID, how do I get it? #772
Comments
Something like this: protected $validationRules = [ |
That's a rule that might be better done in the controller itself, honestly. There are times when 2 layers of validation is a good thing, and you might find that you prefer it all in the controller. Personally, I do validation in the model just to ensure it's valid data. In the controller is validation that determines whether it should be allowed to be stored. In the controller it's also easier to catch the validation issues and redirect back. |
I know in controller is ok, but I like to write the basic logic only in the controller, and pass the database processing to the model. If the model can't get the value of ID, then the model becomes meaningless. |
If you have suggestions on how to handle that, I'm open to hearing them. |
In the model.php page, automatically retrieve the ignored values instead of passing the ignored values. |
In the model file
Ignore_value should be the value of ID, how do I get it?
The text was updated successfully, but these errors were encountered: