Tuesday, 18 February 2014

How to add assets in CodeIgniter

When you are creating a Web Application with CI, you work with assets

you can create a "assets" folder in the root folder

To activate it

Step 1: Create Application Helper

application/helpers/utility_helper.php
function asset_url(){
   return base_url().'assets/';
}

Step 2: application/config/autoload.php:
$autoload['helper'] = array('url','utility');

After this you can very well use asset_url(); with in your application
 Ref

1 comment: