Try the following to make the link text the title of the unit:
'<a href="'.base_url('units/show/'.$unit->id).'">.$unit->title.'</a>'