Welcome Guest, Not a member yet? Register   Sign In
CSS/images folder
#11

[eluser]Craig A Rodway[/eluser]
This is how I have my folder structure:

Code:
+ system
+ www
  + img
  + css
  + js
- index.php
- .htaccess

In my core template:

Code:
<html>
<head>
<base href="<?php echo $this->config->item('base_url') ?>www/" />
<link rel="stylesheet" href="css/base.css" type="text/css" media="screen" />
</head>
<body>
...
<img src="img/foobar.jpg" />
...
&lt;/body&gt;
&lt;/html&gt;

The benefit of this is that each image, javascript and css file doesn't need the full URL each time (less to think about on each asset) and makes pages a few bytes smaller Smile
#12

[eluser]Unknown[/eluser]
[quote author="Craig Rodway" date="1199062284"]This is how I have my folder structure:

Code:
+ system
+ www
  + img
  + css
  + js
- index.php
- .htaccess

In my core template:

Code:
&lt;html&gt;
&lt;head&gt;
&lt;base href="&lt;?php echo $this-&gt;config->item('base_url') ?&gt;www/" />
&lt;link rel="stylesheet" href="css/base.css" type="text/css" media="screen" /&gt;
&lt;/head&gt;
&lt;body&gt;
...
<img src="img/foobar.jpg" />
...
&lt;/body&gt;
&lt;/html&gt;

The benefit of this is that each image, javascript and css file doesn't need the full URL each time (less to think about on each asset) and makes pages a few bytes smaller Smile[/quote]

wow thanks for this!
#13

[eluser]nomikos3[/eluser]
For the record:

Check the asset helper for output css/images/js. http://codeigniter.com/wiki/Asset_Helper/

Code:
<p>
    &lt;?php echo image_asset('homepage.png', 'modulename'); ?&gt;    
</p>




Theme © iAndrew 2016 - Forum software by © MyBB