Reputation: 2729
I am developing an Application in Bonfire.
They have extended the form helper.
Is there a way to call the original form helper from Codigniter without removing the extended one from Bonfire?
Upvotes: 1
Views: 270
Reputation: 11
Faced the same prob, user742736's comment is the only answer that solved the prob. Explained in detail, may be this can help some one
You can create your own helper function with out the divs surrounding the drop down here bonfire/application/helpers/MY_form_helper.php make a copy of the function form_dropdown, name it like form_dropdown_plain
modify the last few lines of the function to output with out divs
call form_dropdown_plain instead of form_dropdown
Upvotes: 0
Reputation: 102745
"Helpers" are just files with PHP functions in them. They aren't actually "extended", Codeigniter loads it's default helpers after loading yours, and checks if you "overwrote" a function like so:
if ( ! function_exists('form_open'))
{
function form_open() {/* default code */}
}
So unfortunately, no - there's no way to call the original function if you already declared your own.
HOWEVER: It appears that Bonfire does the exact same thing, checking with function_exists
, so if you want to - you should be able to load your own form helper before it, but you still cannot simply load the original one without hacking Bonfire and removing the functions (which could have terrible side effects).
Upvotes: 1