[eluser]maria clara[/eluser]
[quote author="ronn" date="1265768719"]I'm new to CodeIgniter and would like to add my JavaScript and CSS the CodeIgniter way. Where in the directory structure would I place the physical files? How would I include them in my view?[/quote]
you can put your JS and CCS files in a separate folder outside your system folder or anywhere you want to put it. And then you can access it in the system/view/templates/header.php if you have a master page as i have.
what matter is your gonna call it and place it in the <head></head> of your view.
like this for example:
Code:
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><? if (isset($ptitle)) echo $ptitle." / " ?>ComUnion ERP ©</title>
<link rel="stylesheet" href="<?=base_url()?>css/default/style.css" type="text/css" />
<link rel="stylesheet" href="<?=base_url()?>css/default/calendar.css" />
<link rel="stylesheet" href="<?=base_url()?>css/default/ui/ui.css" type="text/css" />
<link rel="stylesheet" href="<?=base_url()?>css/default/ac/autocomplete.css" type="text/css" />
<link rel="stylesheet" href="<?=base_url()?>css/flexigrid/flexigrid.css" type="text/css" />
<link rel="stylesheet" href="<?=base_url()?>css/jqthemes/ui.jqgrid.css" type="text/css" />
<link rel="stylesheet" href="<?=base_url()?>css/jqthemes/smoothness/jquery-ui-1.7.2.custom.css" type="text/css" />
<link rel="stylesheet" href="<?=base_url()?>lib/jquery/src/css/jquery.searchFilter.css" type="text/css" />
<link rel="stylesheet" href="<?=base_url()?>lib/jquery/src/css/ui.multiselect.css" type="text/css" />
<!--[if lt IE 7]>
<link rel="stylesheet" href="<?=base_url()?>css/default/style.ie6.css" type="text/css">
<![endif]-->
<!--[if IE ]>
<link rel="stylesheet" href="<?=base_url()?>css/default/style.ie.css" type="text/css">
<![endif]-->
<link rel="shortcut icon" href="<?=base_url()?>favicon.ico" />
<link rel="icon" href="<?=base_url()?>favicon.ico" type="image/x-icon" />
it is like accessing in a external file in native html webpage.