[eluser]robert.fulcher[/eluser]
Ok so this is what I have come up with so far. It seems to work fine but I am still new to CI so I would like to make sure I am not doing something stupid....
Code:
$numsegments = $this->uri->total_segments()- 4;
$target = '';
$segmentstart = 4;
while ($numsegments <> 0) {
$target = $target.$this->uri->segment($segmentstart + 1).'/';
$segmentstart++;
$numsegments--;
};
To explain. This is usually for an edit scenario. In the URI I know where the ID is for the item I will edit. So that ID will be where I start $segmentstart. I have added the destination or $target to the end of the URI like below...
Code:
<?php echo anchor('todo/todo_edit_c/index/'.$todo->id.'/todo/todo_c', 'EDIT');?>
So it works fine but I wonder if there is another and if it would be good to put this into a Help - library - pi not sure it would qualify for.
Thanks for all the great help out there.