sorry different computer now.
here is the controller method:
function registrationForm(){
$this->template->set_template('single');
$this->template->write_view('header', 'templates/header_template');
$this->template->write_view('footer', 'templates/footer_template');
$this->template->write_view('center', 'user/registration_form');
$this->template->add_js('js/jquery.min.js');
$this->template->add_js('js/validate.jquery.js');
$this->template->render();
}
here is the head section:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?= base_url() ?>css/style.css" type="text/css" rel="stylesheet" />
<?= (isset($_scripts)) ? $_scripts : ""; ?>
<?= (isset($_styles)) ? $_styles : ""; ?>
</head>
and the add_js() method:
function add_js($script, $type = 'import', $defer = FALSE)
{
$success = TRUE;
$js = NULL;
$this->CI->load->helper('url');
switch ($type)
{
case 'import':
$filepath = base_url() . $script;
$js = '<script type="text/javascript" src="'. $filepath .'"';
if ($defer)
{
$js .= ' defer="defer"';
}
$js .= "></script>";
break;
case 'embed':
$js = '<script type="text/javascript"';
if ($defer)
{
$js .= ' defer="defer"';
}
$js .= ">";
$js .= $script;
$js .= '</script>';
break;
default:
$success = FALSE;
break;
}
// Add to js array if it doesn't already exist
if ($js != NULL && !in_array($js, $this->js))
{
$this->js[] = $js;
$this->write('_scripts', $js);
}
return $success;
}
template.php config file
/*
|--------------------------------------------------------------------------
| Default Template Configuration (adjust this or create your own)
|--------------------------------------------------------------------------
*/
$template['default']['template'] = 'templates/default_template';
$template['default']['regions'] = array(
'header',
'left',
'right',
'footer',
);
$template['default']['parser'] = 'parser';
$template['default']['parser_method'] = 'parse';
$template['default']['parse_template'] = FALSE;
/*
|--------------------------------------------------------------------------
| Default Template Configuration (adjust this or create your own)
|--------------------------------------------------------------------------
*/
$template['single']['template'] = 'templates/single_template';
$template['single']['regions'] = array(
'header',
'center',
'footer',
);
$template['single']['parser'] = 'parser';
$template['single']['parser_method'] = 'parse';
$template['single']['parse_template'] = FALSE;
/* End of file template.php */
/* Location: ./system/application/config/template.php */