Hello,
I have a controller to display a table, which allows sorting, filtering, editing, pagination... That leads to a few URL parameters: sort column, sort ascending/descending, row offset, filter,... Some of them are optional. For example, usually I will not need a filter. What is the best way to handle that?
My 'edit' function looks like this:
Code:
public function edit($order, $dir, $offset){
if ($this->uri->total_segments() == 7){
$filter = $this->uri->segment(6);
$id = $this->uri->segment(7);
}else{
$filter = '';
$id = $this->uri->segment(6);
}
..... //Edit $id
}
Is this the correct way to do it?
Thanks!