title: Joomla Call to a member function get() on null
body: <p>I have very little php knowledge. I know I'm doing something wrong, but what? </p>
  
  <p>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: </p>
  
  <pre><code>include 'includes/params.php';
  if ($params-&gt;get('compile_sass', '0') === '1') {
      require_once "includes/sass.php";
  }
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>require_once __DIR__ . '/functions/tpl-init.php';
  if ($params-&gt;get('compile_sass', '0') === '1') {
      require_once "includes/html/sass.php";
  }
  </code></pre>
  
  <p>Doesn't work. I get the error: Call to a member function get() on null</p>
  
  <p>So I changed this into: </p>
  
  <pre><code>require_once __DIR__ . '/functions/tpl-init.php';
  require_once "includes/html/sass.php";
  </code></pre>
  
  <p>That works, but now the compiler is permanently on. </p>
  
  <p>What should I do to correct this?</p>