title: Get directory name from path in Smarty only
body: <p><strong>I cannot assign my own PHP function.</strong> (I just have access to the TPL file).</p>
  
  <p>So far I got <code>{$smarty.server.PHP_SELF}</code>, which returns something like <code>/foo/bar.xin</code>. With built in functions, I'd like to get <code>/foo/</code>. </p>