In CodeIgniter I’ve got a view file setup in the root folder, then I’ve got some Javascript files in a js folder as a sub-folder in the view. I tried doing simply:
<script src="js/jquery-blink.js" language="javscript" type="text/javascript"></script>
But this doesn’t seem to work. So is there a specific inclusion technique I need to be performing in order to include my external view requirement files?
By using the URL-helper you can insert a dynamic base URL which you set in the
application/config/config.php:Now, whenever you call the
base_url();function, CodeIgniter will replace it with the set base URL:This line will then become:
Remember that you need to load the helper like this
$this->load->helper('url');or add it in the ‘helpers’ array inapplication/config/autoload.php