I have very little php knowledge. I know I'm doing something wrong, but what?
I'm adding the sass compiler from Joomla Master Bootstrap template into my own Joomla template. It works, but not as it should. I can't turn it on or off in the backend. The code in Masterbootstrap is this:
include 'includes/params.php';
if ($params->get('compile_sass', '0') === '1') {
require_once "includes/sass.php";
}
In my template I don't have params.php, but /functions/tpl-init.php. I added the variable $compile_sass there. My code looks like this:
require_once __DIR__ . '/functions/tpl-init.php';
if ($params->get('compile_sass', '0') === '1') {
require_once "includes/html/sass.php";
}
Doesn't work. I get the error: Call to a member function get() on null
So I changed this into:
require_once __DIR__ . '/functions/tpl-init.php';
require_once "includes/html/sass.php";
That works, but now the compiler is permanently on.
What should I do to correct this?