Welcome Guest, Not a member yet? Register   Sign In
Proposal: Form_validation request method support
#1

[eluser]oliverkalen[/eluser]
I use the form validation library quite often, and have extended it on several occasions without much trouble. I am currently working on an API server that implements REST. It would be nice to see the following methods added to the form validation library:

Code:
$this->form_validation->set_method('get'); // delete, etc.

The method would still default to post.

Secondly, override the standard request method input entirely when dealing with more complex input:

Code:
$input = array(
  'item1' => $this->input->get('item1'),
  'item2' => $this->_some_other_source(),
);
$this->form_validation->set_input($input);


I would be happy to implement the changes and forward them along to a Reactor developer. I am curious to here other thoughts and suggestions.

Added to UserVoice: http://uservoice.com/a/g4EVB
#2

[eluser]oliverkalen[/eluser]
I have attached the proposed change from the most recent Reactor commit. In addition, I have added a result() function to my original proposal:

Code:
$this->form_validation->result();

Returns the resulting data after the validation has been run (to accommodated functions that will manipulate the final result) - primarily used when the input is overridden.

I welcome any feedback.




Theme © iAndrew 2016 - Forum software by © MyBB