Welcome Guest, Not a member yet? Register   Sign In
friendly url to css, images, js and etc. folders using routes.php ?
#4

[eluser]CroNiX[/eluser]
Why would you want to use CI's resources to display simple files? If you use routing, that means you are using CI to pass the request to a controller to process it. So you'd have to manually load the asset in that controller from the filesystem and output it along with the correct headers for that asset type. This can put quite a load on your server for each asset requested (at least 6mb used per request) instead of the webserver, not CI, sending a simple file very efficiently, the way it was designed to.

In order for your controller to work with your routing, your image src needs to be something like

Code:
<img src="&lt;?php echo base_url('images/image_name.jpg'); ?&gt;" alt="" />


Messages In This Thread
friendly url to css, images, js and etc. folders using routes.php ? - by El Forum - 09-26-2012, 09:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB