Blob representation in admin field
I'm implementing ion-auth's user table into Fuel's admin, and that library stores the ip_address field as a blob.
I'm trying to think how to represent this as a field. The value has to be run through inet_ntop() to get the string value, and otherwise the fields show a non-ascii character. I can put the decoded value into 'after_html', but that solution still has the blob char represented. Ideally, I'd like to have a label for the field, the actual value in a hidden input, but don't want the Fuel fields rendering the stored value. The 'custom' field type might be the solution, but when I try it in my user_model, (as per the docs) I get:
call_user_func() expects parameter 1 to be a valid callback, function 'my_custom_field' not found or invalid function name
Comments
I got the error using the example in the docs - literally the same code, just to see if it worked as expected. In form_fields():
$fields['ip_address'] = array('type' => 'custom', 'func' => 'my_custom_field', 'display_label' => FALSE);
Then in the same model:
function my_custom_field($params) { $form_builder =& $params['instance']; $str = $form_builder->create_checkbox($params).' <label for="custom_example">Select this checkbox</label>'; return $str; }
Admittedly, I'm not sure what is being passed in $params!
The error (again) is:
call_user_func() expects parameter 1 to be a valid callback, function 'my_custom_field' not found or invalid function name
$fields['ip_address'] = array('type' => 'custom', 'func' => array($this, 'my_custom_field'), 'display_label' => FALSE);