Two questions regarding hiding fields

Comments

  • edited 11:33AM
    If it's a field you really don't want displayed or have no need for it, you can use;
    function form_fields($values = array(), $related = array()) { $fields = parent::form_fields($values, $related); unset($fields['my_hidden_field']); return $fields; }

    Otherwise, you will need to use something like htmlentities on the data, which can be done by overwriting the find_one_array method on your model:
    function find_one_array($where = array(), $order_by = NULL, $return_method = NULL) { $data = parent::find_one_array($where, $order_by, $return_method); $data['my_hidden_field'] = htmlentities($data['my_hidden_field']); return $data; }
    Or you can create your own method and specify in your module's config the "edit_method" value which by default is the "find_one_array" method.
Sign In or Register to comment.