0

I'm using CodeIgniter for the first, I added my html files in the views folder & css,jss, images in the assets folder.

Now my css etc not appearing in the layout, kindly let me know how to include/urls?

Thanks!

3
  • Show us your code... Commented Oct 23, 2017 at 11:27
  • Show your code please Commented Oct 23, 2017 at 11:28
  • <link rel = "stylesheet" href = "<?php echo base_url(); ?>assets/css/stylesheet.css"> Commented Oct 23, 2017 at 18:26

2 Answers 2

2
go to -> your_project->application->config->config.php

open config.php

add base path of your project

$config['base_url'] = 'http://localhost/yourProject/';

and add asset path (img, css, js)

define('ASSET_PATH',$config['base_url'].'assets/');

make sure your all css files in assets folder like this:

assets->css->style.css
assets->js->style.js

and finally used in view

<link href="<?php echo ASSET_PATH; ?>css/style.css" rel="stylesheet">
Sign up to request clarification or add additional context in comments.

Comments

0

suppose your css folder path like

example : projectfolder/assets/css/style.css

so in view file you can use below code

<link rel = "stylesheet" type = "text/css" href = "<?php echo base_url(); ?>assets/css/style.css">

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.