Adding icons or other html to a simple module's list_items()
I think it was possible to add html to columns in the list_items() display back in v.093, but I can't find the example I'm thinking of.
For instance, if there is a url column which is a path to an icon or thumbnail, is it possible to show that as an img tag in the simple module list page?
Comments
Just for the record:
function list_items($limit = NULL, $offset = NULL, $col = 'name', $order = 'asc', $just_count = FALSE) { $this->db->select('id, name, link, active, icon_img'); $data = parent::list_items($limit, $offset, $col, $order, $just_count = FALSE); foreach($data as $key => $value) { $data[$key]['icon'] = '<img width="32" src="'.img_path($data[$key]['icon_img']).'">'; } return $data; }
This example creates an img tag using the file path in the column icon_img. $data[$key]['icon'] is a new column for the tag.