Everything that is in the /application CodeIgniter folder should be considered as beyond. For maximum security, you should consider storing /application over your www or public_html folder in a structure like this:
β application β controllers β models β views β ... β system β core β libraries β ... β public_html β index.php
This makes your application code more secure.
Id advises creating your client scripts and CSS in a shared folder. For example public_html/css and public_html/js . Or, if you want to go down a topic of a route, perhaps name each CSS file as the name of the theme, so youd have css/theme1.css and css/theme2.css .
If your site will always work from the root of the domain, you can simply use:
<link rel="stylesheet" type="text/css" href="/css/layout.css" media="screen" />
But if you feel that you will be collecting all kinds of things, think about preparing the location of the file in the controller before sending it to Smarty.
$this->load->helper('url'); $this->smarty->assign('css_file', base_url("css/theme1.css"));
This will return:
http:
Or whatever your CodeIgniter url is.
source share