如何在prestashop中获取管理文件夹的名称? [英] How to get name of admin folder in prestashop?

查看:61
本文介绍了如何在prestashop中获取管理文件夹的名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$link= PS_ADMIN_DIR;
$admin_folder = substr(strrchr($link, "\ "), 1);

目前我正在使用这种方式获取文件夹名称,但是如果有任何直接的方法或任何常数,请建议我..谢谢

currently i am using this way to get folder name, But if there are any direct method or any constant please suggest me.. Thanks

推荐答案

出于安全原因,admin 文件夹名称不会存储在 PrestaShop 文件或数据库中的任何位置,因此您必须执行类似操作才能找到它.

For security reasons, admin folder name is not stored anywhere in your PrestaShop's files or database, so you have to do something like you do to find it.

但是,您应该使用 _PS_ADMIN_DIR_ 而不是 PS_ADMIN_DIR 因为第二个不是由 PrestaShop 直接定义的,并且可能未定义.

However, you should use _PS_ADMIN_DIR_ instead of PS_ADMIN_DIR as the second one is not defined directly by PrestaShop and could be undefined.

这篇关于如何在prestashop中获取管理文件夹的名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆