CodeIgniter Forums
URL to load page and move to named item - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: URL to load page and move to named item (/showthread.php?tid=53303)



URL to load page and move to named item - El Forum - 07-18-2012

[eluser]bazianm[/eluser]
Hi,

I am converting a website from static html to codeigniter. They have some links that refer to bookmarks within the page e.g.
Code:
http://www.mysite.com/mypage.html#mybookmark
. How can I do this with codeigniter?


URL to load page and move to named item - El Forum - 07-18-2012

[eluser]TWP Marketing[/eluser]
[quote author="bazianm" date="1342638854"]Hi,

I am converting a website from static html to codeigniter. They have some links that refer to bookmarks within the page e.g.
Code:
http://www.mysite.com/mypage.html#mybookmark
. How can I do this with codeigniter?[/quote]

The URL format using CI would be something like this:

Code:
htt p://www.mysite.com/index.php/controller/function#mybookmark

If you are coding this as a link within a page, use current_url(), for example:

Code:
<? php echo current_url().'#mybookmark';?>
EDIT, not the spaces added to avoid this forums anti-spam protection