如何在prestashop tpl页面中获取SERVER ['DOCUMENT_ROOT']

时间:2014-01-29 06:13:51

标签: frameworks themes smarty prestashop document-root

任何人都可以帮助我吗? 我需要在tpl页面中的document_root变量值。 我使用presta商店作为框架。有没有办法得到它?

2 个答案:

答案 0 :(得分:3)

您需要在Prestashop挂钩中为该

指定一个smarty变量
$this->context->smarty->assign('document_root', $_SERVER['DOCUMENT_ROOT'])

在你的tpl文件中使用它。

{$document_root}

答案 1 :(得分:3)

您可以使用{$smarty.const._PS_ROOT_DIR_}

获取商店的绝对路径