H
H
HeartOfProgrammer2015-11-16 17:49:06
CodeIgniter
HeartOfProgrammer, 2015-11-16 17:49:06

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

2 answer(s)
D
De YURII, 2015-11-16
@Dejurin

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);
}

View/Header.php
<?php
    if (!empty($style_css)): 
      foreach ($style_css as $css): ?>
          <link href="<?php echo site_url($css); ?>" rel="stylesheet">
    <?php 
      endforeach;
    endif;
    ?>

A
Alexander Wolf, 2015-11-16
@mannaro

First link on google

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question