title: Passing Variable from Codeigniter session class to FPDF class
body: <p>I'm having a bit of trouble setting the Header and Footer of a PDF I'm creating with FPDF and Codeigniter framework. in this code i can't echo $user variable to my Header. What must i do to get that variable ?.. 
  The code for the class is the following:</p>
  
  <pre><code>&lt;?php
  date_default_timezone_set('Asia/Jakarta');
  $user=$this-&gt;session-&gt;userdata('name');
  
  class printFPDF extends FPDF{
      var $user;
      function userdata($user){
          $this-&gt;user=$user;
      }
      // Page header
      function Header(){
          global $user;
          // Arial bold 15
          $this-&gt;SetFont('Arial','I',8);
          // Move to the right
          $this-&gt;Cell(1);
          // Title
          $this-&gt;Cell(30,10,"Created by ".$this-&gt;user,0,0,'L');
          // Move to the right        
          $this-&gt;Cell(190);
          // Line break
          $this-&gt;Ln(15);
      }
  }
  </code></pre>
  
  <p>Any help would be appreciated.</p>