4

以下のコードを使用して append_css を試みています。古いプロジェクトでは、以下のコードは通常機能します。参考までに、私は CodeIgniter とテンプレート Sparks を使用しています

    public function __construct() {
    parent::__construct();
    $this->load->library('template');
    $this->template
            ->append_css('/public/css/app.css');
  }
    public function index(){    
        $this->template->build('welcome_message.php');
    }
}

次のエラーが表示されます

Fatal error: Call to undefined method Template::append_css() in /Users/Afont/quals/codeigniter-test/application/controllers/welcome.php on line 9
4

1 に答える 1

2

First, in your autoload.php, you may want to autoload the spark:

$autoload['sparks'] = array('template/1.9.0');

Second, looking through the code, it seems that there is no append_css function. In PyroCMS, the library appears to have that function, but not the spark by default.

于 2013-08-15T20:32:47.787 に答える