0
我添加了一個名爲「css_url」的新函數。我在控制器的構造函數中設置,它工作。 此外,我想要在資產範圍內。在視圖目錄中放置主題,每個主題都有自己的資源。我如何能夠在視圖目錄中訪問資源?視圖中的Codeigniter css
-view
--theme1
---assets
----css
----js
----images
-----f1.jpg
在這裏輸入的代碼
public function __construct() {
parent::__construct();
// Temel veriler veri tabanından çekilecek;
$this -> theme = "theme1";
$this->config->set_item('css_url', $this->theme);
}
css_url( 「圖像/ f1.jpg」);
最佳實踐,將您的資產,主題文件夾位於codeigniter根目錄下,這是應用程序和系統文件夾的位置。因此,您可以使用'base_url()'方便地訪問它。 讓我知道如果您需要進一步幫助 – Zeeshan 2014-09-04 14:57:39