Welcome Guest, Not a member yet? Register   Sign In
Return to differnt views
#7

[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:
&lt;?php echo anchor('todo/todo_edit_c/index/'.$todo->id.'/todo/todo_c', 'EDIT');?&gt;

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.


Messages In This Thread
Return to differnt views - by El Forum - 06-18-2009, 02:23 PM
Return to differnt views - by El Forum - 06-18-2009, 03:31 PM
Return to differnt views - by El Forum - 06-18-2009, 03:35 PM
Return to differnt views - by El Forum - 06-18-2009, 03:52 PM
Return to differnt views - by El Forum - 06-18-2009, 03:56 PM
Return to differnt views - by El Forum - 06-18-2009, 07:05 PM
Return to differnt views - by El Forum - 06-18-2009, 08:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB