there is disadvantage to this and that is when I’m validating my inputs the model sends back a message that doesn’t comply with the way that I handle forms.
see this example of an error message that the model ‘Users’ sends to me
"{"Users_email":["Email is not a valid email address."]}"
the model is using the name "Users_email" cause normally this is the id of email input created by form widget
but in my custom made form I have a different id and stuff.
so I’m looking for a way that model would assign a different name for my input the way I need it to be.
First, the best one, most recommended. Recode your application to use the proper way of Yii.
Second, if you only need to focus on getting the validation error message and keep the way of your view built, use the form widget and display the error message with
Third, the focus is similar with the second one but you don’t want to use the form widget, modifies your controller to add the lines for getting the validation error message of each model’s attribute, keep it in the variable (one variable for one attribute), and pass the variable on view rendering. Your controller should add the line like this: