title: Access Smarty Template
body: <p>My file structure:</p>
  
  <pre><code>--header.php
  --smarty
    --templates
      -- x.tpl
    --cache
    --configs
    --templates_c
  --articles
    -- testPage.php
  </code></pre>
  
  <p>Code in header.php</p>
  
  <pre><code>$smarty = new Smarty();
  
  $smarty-&gt;setTemplateDir('smarty/templates');
  $smarty-&gt;setCompileDir('smarty/templates_c');
  $smarty-&gt;setCacheDir('smarty/cache');
  $smarty-&gt;setConfigDir('smarty/configs');
  </code></pre>
  
  <p>Code in testPage.php</p>
  
  <pre><code>&lt;?php
    include('../header.php');
    $smarty-&gt;display('x.tpl');
  ?&gt;
  </code></pre>
  
  <p>I am hitting this error:</p>
  
  <pre><code>PHP Fatal error:  Uncaught exception 'SmartyException' with message 'Unable to 
  load template file 'x.tpl'' in
  /usr/local/lib/php/Smarty/sysplugins/smarty_internal_templatebase.php:127
  </code></pre>
  
  <p>How to set the correct path to access the smarty template in my testPage.php?</p>