Welcome Guest, Not a member yet? Register   Sign In
Grab URL value...
#1

[eluser]woomacoder[/eluser]
Hello,

I have a problem; I wanna grab a single part of url, for example:

domain.com/index.php/controller-name/apple-iphone-3g-16gb-black-1

I wanna read in my controller-name, the 1 (ID) of url..., the latest item.
But... i'dont now Sad

Sorry for my english.
Thank you"
#2

[eluser]Dam1an[/eluser]
If you split it up so each part of the item is a seperate URI segment, you can easily grab them using uri->segment

In the current way, you can always get the second segment, which will return "apple-iphone-3g-16gb-black-1" and then explode on the '-' and assuming its always the last part, get the last item in the array
#3

[eluser]woomacoder[/eluser]
Yes, it's a good solution! Thank you damian Wink




Theme © iAndrew 2016 - Forum software by © MyBB