Welcome Guest, Not a member yet? Register   Sign In
Newbie CI question
#11

[eluser]cahva[/eluser]
Dont include index.php to base_url. What would be the point doing that? If you havent used mod_rewrite to get rid of index.php, it is set with $config['index_page']. When using anchor(), site_url() etc. it is automatically added.

Also in the view files when you point to some picture(or css file or any other asset), you would use base_url() function to get the url to your ci app. For example:
Code:
<img src="&lt;?php echo base_url() ?&gt;images/foo.jpg" alt="">
Imagine if you had your index.php set in the base_url config.. You couldnt use that in your view files as it would give you false url to the image:
Code:
<img src="http://localhost/CI/test1/index.php/images/foo.jpg" alt="">


Messages In This Thread
Newbie CI question - by El Forum - 05-12-2010, 02:04 AM
Newbie CI question - by El Forum - 05-12-2010, 02:07 AM
Newbie CI question - by El Forum - 05-12-2010, 02:18 AM
Newbie CI question - by El Forum - 05-12-2010, 02:26 AM
Newbie CI question - by El Forum - 05-12-2010, 02:29 AM
Newbie CI question - by El Forum - 05-12-2010, 02:36 AM
Newbie CI question - by El Forum - 05-12-2010, 02:41 AM
Newbie CI question - by El Forum - 05-13-2010, 03:53 PM
Newbie CI question - by El Forum - 05-13-2010, 04:25 PM
Newbie CI question - by El Forum - 05-13-2010, 04:30 PM
Newbie CI question - by El Forum - 05-13-2010, 04:35 PM
Newbie CI question - by El Forum - 05-13-2010, 04:35 PM
Newbie CI question - by El Forum - 05-13-2010, 05:29 PM
Newbie CI question - by El Forum - 05-13-2010, 06:28 PM
Newbie CI question - by El Forum - 05-15-2010, 02:23 PM
Newbie CI question - by El Forum - 05-15-2010, 05:17 PM
Newbie CI question - by El Forum - 05-15-2010, 05:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB