嗨我在加載css文件時遇到問題。css無法加載
<?php //if (! defined("BASEPATH")) exit("No direct script access allowed");
class Controller2 extends CI_Controller
{
function index()
{
if ($this->input->post('button'))
$this->test();
else
$this->load->view('2');
}
function test()
{
$this->load->view('2');
}
} ?>
當我首先調用它加載視圖我的控制器指數函數「2」以適當的HTML和CSS但是當我按下內部我的「2」的按鈕查看我的控制器是調用另一個函數TEST,但這次測試不會加載與CSS相同的視圖。
任何人都可以解決這個問題嗎?
你爲什麼呀?爲什麼調用另一個方法來加載視圖,而不是直接從視圖中加載視圖(事實上,你的條件語句畢竟會返回相同的結果)。我只是混淆,你爲什麼這樣做? – toopay