Calling the undefined Template :: append_css () method

I am trying append_css to use the following code. In older projects, normal code usually works. For reference, I am using CodeIgniter and the Sparks template.

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'); } } 

I get the following error

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

First, in your autoload.php you may need to autoload a spark:

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

Secondly, looking at the code, it seems that there is no append_css function. In PyroCMS library seems to have this feature, but not a spark by default.

+2
source

Source: https://habr.com/ru/post/1497318/


All Articles