Welcome Guest, Not a member yet? Register   Sign In
SVN url helper : current_url function added
#3

[eluser]sophistry[/eluser]
@xwero... i am having trouble understanding the utility of this function. that's not to say i don't value it... i simply don't understand what it is doing! ;-)

could you explain a little more how this is useful. i see your comment about using it in a form action attr. and i tried to divine why the CI site_url() method accepts a uri parameter but i couldn't see why. i thought it was just a simple function but you've shown an interesting use for it that i don't quite understand.

finally, what the heck is this regex in the site_url() method doing anyway (i'm pretty versed in regex and i am stumped as to what this does or for what purpose): EDIT: i understand the regex capturing expression to mean it is looking for the any number (including zero) of slashes then at least one character (ungreedy), then any number of slashes again (or zero slashes), then the end of the string. but, what does it find in between those slashes? doesn't it only find one segment??

Code:
return $this->slash_item('base_url').$this->slash_item('index_page').preg_replace("|^/*(.+?)/*$|", "\\1", $uri).$suffix;

thanks!

EDIT 2: i see that the function you are talking about is in the CI SVN now... and i see the note
Quote:Returns the full URL (including segments) of the page being currently viewed.
about it in the SVN userguide but i still don't get how it is doing what it is doing.


Messages In This Thread
SVN url helper : current_url function added - by El Forum - 08-20-2008, 02:24 AM
SVN url helper : current_url function added - by El Forum - 08-20-2008, 05:28 AM
SVN url helper : current_url function added - by El Forum - 08-20-2008, 08:09 AM
SVN url helper : current_url function added - by El Forum - 08-26-2008, 03:58 AM
SVN url helper : current_url function added - by El Forum - 09-17-2008, 04:09 AM
SVN url helper : current_url function added - by El Forum - 09-17-2008, 04:45 AM
SVN url helper : current_url function added - by El Forum - 09-18-2008, 02:37 AM
SVN url helper : current_url function added - by El Forum - 09-18-2008, 03:18 AM
SVN url helper : current_url function added - by El Forum - 09-18-2008, 03:28 AM
SVN url helper : current_url function added - by El Forum - 09-18-2008, 10:37 PM
SVN url helper : current_url function added - by El Forum - 09-19-2008, 12:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB