Welcome Guest, Not a member yet? Register   Sign In
The style sheet for a view page can't be separated in an Includes folder?
#7

[eluser]CroNiX[/eluser]
If you have things structured the way I showed them and use the traditional HTML ways of bringing the asset into your html, like I showed, it will work just fine. You just can't have your assets in one of the protected directories, which "views" is because it's located within "application" which has a htaccess file blocking direct access.

Look at the structure of what I posted. The asset dirs (css/js/images) are at the same level as index.php, which is accessible via the url as it's public. You could type "http://www.yoursite.com/images/myimage.jpg" in your browser and the image would load like normal. There's no magic here, just using regular HTML and having your assets located in a publicly accessible place.

Also remember if you use a php "include" to bring an asset in, it will slow your page load speed as your browser is fetching a larger file, rather than 2 individual files which the browser can load in parallel.

You also mention using "include", which you shouldn't have to do. CI has load methods which can load views and other things like libraries. You should be using those instead of "including" anything.


Messages In This Thread
The style sheet for a view page can't be separated in an Includes folder? - by El Forum - 07-24-2012, 11:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB