[eluser]Moobies[/eluser]
hi,
that's fine, but it does not address the fundamental issue with its use in prepopulating form values as nicely as possible. i presented 2 alternatives above, my option, and the only other option i could think of using set_value with a default.
so what do you think?
in fact, the set_value with a default on a create form (i.e. with no backing object) would cause a php error, so you'd either have to check for non-null or suppress the error, e.g.
Code:
<input type=“text” name=“name” value=”<?php echo set_value(‘name’, @$myobj->name) ?>” >
again, i think this is ugly when there is already conditional checks in the controller to determine whether a create or edit is happening.
set_value in the controller does not have any influence on the form input helper version of set_value and that's because set_value is actually returning the default value from the function. my solution actually places the value in the Form_validation's internal data array so it's found by the alias helper version too.
i still think my way is better unless you can convince me otherwise

)