Skip to content
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

using form_validation->set_data, and .. #153

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

alzalabany
Copy link

other than hacking $_POST use native form_validation->set_data($data);

and added 2nd param for function validate(data,parital) to only apply rules for submitted data.

(useful when updating row, as u can update user.middle_name without having to submit all other user table required fields for example).

other than hacking $_POST use native form_validation->set_data($data); and added 2nd param for function to only apply rules for submited data (useful when updating row, as u can update user.middle_name without having to submit all other required fields for example).
$this->load->library('form_validation');
$this->form_validation->reset_validation();
$this->form_validation->set_data($data); #we are not using $_post hacking..

if(is_array($this->validate))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

partial only applies when $this->valdate is an array of rules..

@jamierumbelow
Copy link
Owner

Thanks!

A couple of things:

  • Do you think you could write tests for this?
  • I see that you're using array literal bracket syntax on line 821 ($config=[];). This ties users into using >PHP5.4, for very little benefit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants