This is a quick tip, I wanna share with you all.
many of you must be using CodeIgniter for development of web apps. And I know everyone of you must have faced the problem of asset management (css, JS, images) in Codeigntier. Well here’s a quick tip for it and making it hassle free.
use of base tag in head section
First of all place all your files in some folder, this is how I use it. I always create three folders viz. css, images and js in root folder of codeigniter app. Then add following in head section
<base href=”<?php echo base_url(); ?>” />
After this, u can use only partial links in all you linking relative to you base href’s property!
and thats all, You won’t have to include base_url all the time in your codes for linking. It can be used for everything like images, scripts, css files etc.
Hope you find it useful!