Welcome Guest, Not a member yet? Register   Sign In
extending core class input (v2.0.1)
#1

[eluser]fajnalowiec[/eluser]
Is it possible to create my own extended core class input and use it simultaneously with the basic input class?
I am lazy and forgetful, so I created MY_Input inherited from CI_Input for automatic trim and htmlspecialchars_decode all $_POST data. But there are a little data like form->input->password or data from CKEditor (which is already html_entity_decoded) which I would like to read by basic CI input.
The point is; it would would be nice to name my inherited class for example "MY_Input2", then load it as library "input2" and then in controller use it "$this->input2->post(...)" or use the native CI_Input like this "$this->input->post(...)" whenever I want one or the second.
#2

[eluser]cideveloper[/eluser]
MY_Input is just Extending the Native Input Library. Why dont you just do it like this

Code:
$this->input->post_ext(...)

as in make a new post function called post_ext [post extended] in MY_Input

That way you can use


Code:
$this->input->post_ext(...)

or


Code:
$this->input->post(...)
#3

[eluser]fajnalowiec[/eluser]
thanks a lot. I have focused too much on my idea. I used post with predefined params:
function post($index = NULL, $xss_clean = FALSE, $enable_htmlspecialschars_decode = TRUE, $enable_trim = TRUE)
but Your solution is quite better.




Theme © iAndrew 2016 - Forum software by © MyBB