Created
February 11, 2015 20:49
-
-
Save Nav-Appaiya/f44c78a7bdcf4fabe06b to your computer and use it in GitHub Desktop.
CI Asset locations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| I have a setup like this: | |
| application | |
| system | |
| assets | |
| js | |
| imgs | |
| css | |
| I then have a helper function that simply returns the full path to this depending on my setup.. something similar to: | |
| application/helpers/utility_helper.php: | |
| function asset_url(){ | |
| return base_url().'assets/'; | |
| } | |
| I will usually keep common routines similar to this in the same file and autoload it with codeigniters autoload configuration. Note: autoload URL helper for base_url() access. | |
| application/config/autoload.php: | |
| $autoload['helper'] = array('url','utility'); | |
| You will then have access to asset_url() throughout your code. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment