Answer the question
In order to leave comments, you need to log in
How to include css styles in codeigniter?
I tried all the options for including css styles in codeigniter, but none of them worked. Maybe I did something wrong. Please give a link to the documentation, and the correct connection of css styles. I searched the Internet, I did not find it (I searched badly, perhaps).
Answer the question
In order to leave comments, you need to log in
Documentation you will not find information on how to include styles, you can do it in the template.
Since I often use additional styles for different pages, I did this:
Controller
public function name() {
$pattern['style_css'] = array('style1.css','style2.css');
$this->load->view('header', $pattern);
}
<?php
if (!empty($style_css)):
foreach ($style_css as $css): ?>
<link href="<?php echo site_url($css); ?>" rel="stylesheet">
<?php
endforeach;
endif;
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question