2017-02-21 200 views
0

在Codeigniter中未加載用base_url()加載的所有內容。未在Codeigniter中加載CSS和圖片

<link href="<?php echo base_url(); ?>other/css/admin/style.css" rel="stylesheet" type="text/css"> 
<img class="brand" src="<?php echo base_url(); ?>other/img/logo.png"> 

中有:

WAMP - > WWW - >其他 - > CSS/IMG

我BASE_URL是:

$base_url = 'http://localhost/'; 
+0

你是什麼'base_url'? –

+0

你知道嗎(http://stackoverflow.com/a/6449396/3898339)如何使用'base_url()' –

+0

當然,我這樣做。看到上面的例子。 – prezli

回答

0

改變自己的基本網址到這一點:

$base_url = 'http://localhost/PROJECTNAME/'; 

這裏的 「PROJECTNAME」 是你的項目目錄。

0

更改BASE_URL變量是這樣的:

$base_url = 'http://localhost/other/'; 

,其中 「其他」 是該項目的文件夾

0

更改基本URL這樣的:

$base_url = '/';