title: Accessing custom variables from a .phtml in Magento
body: <p>I have a file (js.phtml) where my code executes. I need to access some user data. When I error_log($this) in js.phtml, it displays, "Mage_Core_Block_Template" - which is confusing to me. I would expect that to be the parent class, not the value of the class getting passed to my .phtml file.</p>
  
  <p>So, how do I supply the .phtml file with custom objects or methods? I'm super new to Magento and I've just been dropped into a task, so I apologize for possibly using incorrect terminology. </p>
  
  <p>Edit:
  My full file path is: </p>
  
  <ul>
  <li>/app/design/frontend//default/template/customer/welcome/js.phtml</li>
  </ul>
  
  <p>There is also a full module dir here: </p>
  
  <ul>
  <li>/app/code/local//Customer/</li>
  </ul>
  
  <p>Edit: 
  I need access to the users country and userid. It's ok if country is null.</p>
  
  <p>Edit:
  I've been doing additional research, it looks like I can do something like this: 
  <a href="https://stackoverflow.com/questions/416553/current-user-in-magento">Current user in Magento?</a></p>
  
  <p>But I haven't tried it in code yet ....</p>
  
  <p>Edit: Figured it out:</p>
  
  <pre><code>error_log(print_r(Mage::getSingleton('customer/session')-&gt;getCustomer()-&gt;getEntityId(), true));
  error_log(print_r(Mage::getSingleton('customer/session')-&gt;getCustomer()-&gt;getCountry(), true));
  </code></pre>