CodeIgniter URL Helper

This helper is loaded using the following code:


URL Helper

See the below table, you will get the list of URL helper function of codeigniter with the output url like anchor link, popup window etc

URL Helper Function Output URL
site_url ()
site_url (‘blog’)
site_url (‘blog/id/123’)
$segments = array(‘blog’, ‘post’, ‘123’);

echo site_url ($segments)
base_url ()
base_url (“blog/post/123”)
base_url (“/templates/images/icons/user.png”)
current_url ()
uri_string () blog/post
index_page () index.php
anchor() <a href=””>
anchor(“blog/post/123”) <!– SHOW WINDOW POP UP –>

<a href=”″>

echo anchor (‘blog/post/123’, ‘Post’,  ‘title=”My Post”‘) <a title=”My Post” href=”″> Post </a>
$atts = array(

‘width’ => ‘800’,

‘height’ => ‘600’,

‘scrollbars’ => ‘yes’,

‘status’ => ‘yes’,

‘resizable’ => ‘yes’,

‘screenx’ => ‘0’,

‘screeny’ => ‘0’


echo anchor_popup (‘blog/post/123’, ‘Click Me!’, $atts)

<a onclick=”‘’, ‘_blank’, ‘width=800,height=600,scrollbars=yes,status=yes,resizable=yes,screenx=0,screeny=0’);” href=”javascript:void(0);”>
Click Me!
mailto (‘’, ‘Mail Me’) <a href=””>Mail Me</a>
$url = “”;

echo $url = prep_url($url)
//Addthe http:, if not available