Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Seperate Form Validation for Create & Edit Users, to differentiate password validation
  • I am creating a user scaffold that allows me to perform CRUD for the users from the admin panel. Not sure if im doing this right though.. I ran oil g admin users <userfields> This generated all of the edit/delete/create/view/list files Create works great.. I am now trying to setup form validation that is different for the create and edit actions. Create: require confirm_password to match password
    Edit: password fields are not available (a checkbox in its place, to send password reset email) however since the validation is set in the model as password:required and confirm_password:required the model throws an error "OutOfBoundsException [ Error ]: Property "password" not found for Model_User." for edit. Any ideas on how i can circumvent this?
  • That is an odd error, because if 'password' is a column it should always be present in the model. What have you exactly done to setup the validation? How have you added "confirm_password' to it, as it is not a column of the model?
  • Its definitely not an "odd error".. FuelPHP sets validation rules in the model. When I create a user i want to validate the password and confirm password When I Edit a user i DO NOT want to validate the password and confirm password, as these fields will not be available in the form.. nor will they be editable. I need to know how i can define validation rules seperately. My User Model: https://gist.github.com/58510987af3f84678a53
    My create form: has confirm_password and password fields
    My Edit form: does not have these fields, as such when validation runs.. it fails because its looking for them to try and validate them

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion