Getting base url for CSS or image loading, modify index.php |
[eluser]renownedmedia[/eluser]
I modified my index.php and added this after the list of define()'s that CI uses: Code: define('SERVERPATH', str_replace("index.php", "", $_SERVER['PHP_SELF'])); Based on the installation directory, SERVERPATH will equal the following: http://localhost/test/index.php -> /test/ http://www.example.com/index.php -> / Which is useful for me and probably a lot of users who do development on a localhost subdirectory and later upload to a real server. My question is if there is a better way to do this, like if CI has this functionality built in without modifying a core file? |
Messages In This Thread |
Getting base url for CSS or image loading, modify index.php - by El Forum - 06-01-2009, 09:14 PM
Getting base url for CSS or image loading, modify index.php - by El Forum - 06-01-2009, 09:31 PM
Getting base url for CSS or image loading, modify index.php - by El Forum - 06-01-2009, 09:46 PM
Getting base url for CSS or image loading, modify index.php - by El Forum - 06-02-2009, 12:54 AM
Getting base url for CSS or image loading, modify index.php - by El Forum - 06-02-2009, 01:41 AM
Getting base url for CSS or image loading, modify index.php - by El Forum - 06-02-2009, 01:58 AM
Getting base url for CSS or image loading, modify index.php - by El Forum - 06-02-2009, 02:04 AM
Getting base url for CSS or image loading, modify index.php - by El Forum - 06-02-2009, 04:50 AM
|