Codeigniter Add Js Css File


Codeigniter Add Js Css File There are many ways to add the js and css files in Codeigniter but the simple way is add js css path in header using base url.


Codeigniter Add Js Css File Example

The simplest and minimal way to include js and css is using base url. In the below example we have created folder named as assets and two folders inside it – js and css which contains the js and css files.

Codeigniter Add Js Css File Example:

<script src="<?php echo base_url('assets/js/jquery.js');?>"></script>
<script src="<?php echo base_url('assets/css/custom.css');?>"></script>

On the same way you can include other files in codeigniter.


Advertisements

Add Comment

📖 Read More