title: Fat-Free-Framework global variables and functions
body: <p>I'm new to fat free framework and i'm a little bit confused about the global variables. </p>
  
  <pre><code>$f3-&gt;route('GET /@page','display');
  
      function display($f3) {
          echo 'I cannot object to an object' . $f3-&gt;get('PARAMS.page');
      };
  
  $f3-&gt;run();
  </code></pre>
  
  <blockquote>
    <p>Here i'm using GET /@page as a token for the url route. In the
    function i then use $f3->get('PARAMS.page') to get the value of that
    variable.</p>
    
    <p>Since $f3->get is the method to get a global variable, why do i have
    to pass the $f3 class to the function.</p>
  </blockquote>
  
  <p><strong>The below code doesn't work ($f3 class not passed to the function).</strong></p>
  
  <pre><code>$f3-&gt;route('GET /@page','display');
  
      function display() {
          echo 'I cannot object to an object' . $f3-&gt;get('PARAMS.page');
      };
  
  $f3-&gt;run();
  </code></pre>
  
  <p>So my question is: why do i have to pass the $f3 class to the function?</p>
  
  <p>Thx...</p>