Does not load the css in the hosting

0

I have a project hosted on a server, I have downloaded a boostrap template, to the welcome.php file of CodeIgniter I indicate the path of the .html file

public function index()
    {
        $this->load->view('/design/index.html');
    }

But when starting the application I get everything without css and I do not know what is due.

I attach an image:

    
asked by Mario Guiber 15.05.2018 в 08:29
source

1 answer

4

To indicate to Codeigniter where your files are css or imagenes you can do it in the following way:

For example, I have at the same level as the folder application a folder called assets and to reference from a view you can use base_url() that leaves you a url absoluta .

<link rel="stylesheet" href="<?echo(base_url() . 'assets/dist/css/mod.css')?>">

I am sending to call a file css that is within assets/dist/css/ , for imágenes is similar.

<img src="<?echo(base_url() . 'assets/dist/img/user2-160x160.jpg')?>" alt="User Image">

Within the same folder assets I have a folder of img , css , js and whatever is necessary.

To load a vista it is not necessary to call the file as such html , you can do it in the following way:

$this->load->view('design/index');
    
answered by 15.05.2018 / 19:35
source