[eluser]ramabodhi[/eluser]
Okay I'm using dynamic links to sort the results...
this is what the code works for, and what did work for awhile.... I have no idea why it stopped..
/inventory/view/$username/$sortField/$sortDirection
i can get as far as sortfield ie: inventory/view/someuser/item_age
that will successfully sort by item age..
once i add it to /inventory/view/someuser/item_age/desc
i lose all my css (though the sorting and display work just fine, but my css disappears)..
the results are sorted in my controller by a custom class thusly
Code:
$data['results'] = $this->data->orderBy($results, $sortField, $sortDirection);
$this->load->view('inventory_view', $data);
the orderBy function in the data library is thus
Code:
function orderBy($array, $index, $order)
{
if($order=='asc'){
$code = "return strnatcmp(\$a['$index'], \$b['$index']);"; usort($array, create_function('$a,$b', $code)); return $array;
}elseif($order=='desc'){
$code = "return strnatcmp(\$b['$index'], \$a['$index']);"; usort($array, create_function('$a,$b', $code)); return $array;
}else return $data;
}
any ideas why my css disappears when i add a fifth uri segment but everything works fine?