当前位置:网站首页>laravel怎么获取到public路径
laravel怎么获取到public路径
2022-07-07 14:07:00 【全栈程序员站长】
app_path()
app_path函数返回app目录的绝对路径:
$path = app_path();
你还可以使用app_path函数为相对于app目录的给定文件生成绝对路径:
$path = app_path('Http/Controllers/Controller.php');
base_path()
base_path函数返回项目根目录的绝对路径:
$path = base_path();
你还可以使用base_path函数为相对于应用目录的给定文件生成绝对路径:
$path = base_path('vendor/bin');
config_path()
config_path函数返回应用配置目录的绝对路径:
$path = config_path();
database_path()
database_path函数返回应用数据库目录的绝对路径:
$path = database_path();
public_path()
public_path函数返回public目录的绝对路径:
$path = public_path();
storage_path()
storage_path函数返回storage目录的绝对路径:
$path = storage_path();
还可以使用storage_path函数生成相对于storage目录的给定文件的绝对路径:
$path = storage_path('app/file.txt');
获取laravel项目的路径的内置帮助函数基本都在这了发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/113203.html原文链接:https://javaforall.cn
边栏推荐
- You Yuxi, coming!
- 分步式监控平台zabbix
- Summary of knowledge points of xlua hot update solution
- Shader_ Animation sequence frame
- 修改配置文件后tidb无法启动
- 无线传感器网络--ZigBee和6LoWPAN
- Vs tool word highlight with margin
- A JS script can be directly put into the browser to perform operations
- nodejs package. JSON version number ^ and~
- SysOM 案例解析:消失的内存都去哪了 !| 龙蜥技术
猜你喜欢

PyTorch 中的乘法:mul()、multiply()、matmul()、mm()、mv()、dot()

Three. JS introductory learning notes 08:orbitcontrols JS plug-in - mouse control model rotation, zoom in, zoom out, translation, etc

C4D learning notes 1- animation - animation key frames

Continuous creation depends on it!

分步式監控平臺zabbix

Excessive dependence on subsidies, difficult collection of key customers, and how strong is the potential to reach the dream of "the first share of domestic databases"?

Three. JS introductory learning notes 03: perspective projection camera

Strengthen real-time data management, and the British software helps the security construction of the medical insurance platform

AE learning 01: AE complete project summary

C4D learning notes 2- animation - timeline and time function
随机推荐
Talk about the cloud deployment of local projects created by SAP IRPA studio
What else can an ordinary person do besides working in a factory to make money?
Three. JS introductory learning notes 05: external model import -c4d into JSON file for web pages
nodejs package. JSON version number ^ and~
Description of vs common shortcut keys
统计学习方法——感知机
What about the pointer in neural network C language
Numpy -- data cleaning
Summary of knowledge points of xlua hot update solution
Performance comparison of tidb for PostgreSQL and yugabytedb on sysbench
2022第四届中国(济南)国际智慧养老产业展览会,山东老博会
Xcode Revoke certificate
招标公告:福建省农村信用社联合社数据库审计系统采购项目(重新招标)
three.js打造酷炫下雪效果
Good news! Kelan sundb database and Hongshu technology privacy data protection management software complete compatibility adaptation
保证接口数据安全的10种方案
用手机在通达信上开户靠谱吗?这样炒股有没有什么安全隐患
Shader basic UV operations, translation, rotation, scaling
Three. JS introductory learning notes 15: threejs frame animation module
Three. JS introductory learning notes 13: animation learning