Tuesday, 8 March 2016

Load CSS in CodeIgniter


Perfect way to load css, js, images and other assets in codeigniter 


Step 1 : To attach a CSS, JS, Images .etc you just have to do is go to your config folder and write at the end of the constant.php file.


constant.php 


define('URL','ADD YOUR LOCAL/REMOTE PATH');

define('CSS',URL.'public/css/');
define('IMAGES',URL.'public/images/');
define('JS',URL.'public/images/');


Step 2 : After that goto your view and in the link just add

<link rel="stylesheet" type="text/css" href="<?php echo CSS; ?>mystyle.css">

Related Articles

0 comments:

Post a Comment

Prompt Web Solution. Powered by Blogger.