CodeIgniter - Which function to use for URL's -
im building first application using codeigniter, need bit of advice.
there 2 functions same thing , wondering best use.
ok, when im building site, link homepage simple / if building on directory, take root public_html directory, codeigniter have found both
site_url()
and
base_url()
but, both seem same thing .. wondering if theres difference, 1 better use, etc etc.
cheers,
if using index.php
site_url()
will include index.php , and
base_url()
will not include it.
if creating url pass, use
site_url('images/img.png')
otherwise...
base_url().'images/img.png'
Comments
Post a Comment