In Smarty, is there a way to retrieve the current physical path of the template file?
I'm looking for the Smarty equivalent of the PHP __FILE__ super-variable.
(I'm sure that this question must have been asked before, but I can't for the life of me find it. Or maybe there's a good reason it hasn't been asked!?)
Have a look at the {$smarty} reserved variable.
{$smarty.const.CONST_NAME}, but that will give you the compiled file's path in the case of __FILE__
{$smarty.current_dir} & {$smarty.template}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With