当前位置:网站首页>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
边栏推荐
- 招标公告:福建省农村信用社联合社数据库审计系统采购项目(重新招标)
- Xingruige database was shortlisted as the "typical solution for information technology application and innovation in Fujian Province in 2021"
- Numpy -- epidemic data analysis case
- 分类模型评价标准(performance measure)
- Use moviepy Editor clips videos and intercepts video clips in batches
- 分步式监控平台zabbix
- Postman generate timestamp, future timestamp
- AB package details in unity (super detail, features, packaging, loading, manager)
- Three. JS introductory learning notes 0: illustration of how webgl and threejs work
- Strengthen real-time data management, and the British software helps the security construction of the medical insurance platform
猜你喜欢
Whole process analysis of unity3d rendering pipeline
Three. JS introductory learning notes 10:three JS grid
numpy--数据清洗
numpy--疫情数据分析案例
模仿企业微信会议室选择
numpy---基础学习笔记
What about the pointer in neural network C language
PyTorch 中的乘法:mul()、multiply()、matmul()、mm()、mv()、dot()
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"?
统计学习方法——感知机
随机推荐
What are compiled languages and interpreted languages?
Logback logging framework third-party jar package is available for free
121. 买卖股票的最佳时机
航运船公司人工智能AI产品成熟化标准化规模应用,全球港航人工智能/集装箱人工智能领军者CIMC中集飞瞳,打造国际航运智能化标杆
numpy--数据清洗
Logback日志框架第三方jar包 免费获取
Unity drawing plug-in = = [support the update of the original atlas]
AE learning 01: AE complete project summary
Xingruige database was shortlisted as the "typical solution for information technology application and innovation in Fujian Province in 2021"
安科瑞电网智能化发展的必然趋势电力系统采用微机保护装置是
It's different for rich people to buy a house
分步式監控平臺zabbix
Xcode Revoke certificate
Unity3d click events added to 3D objects in the scene
TS typescript type declaration special declaration field number is handled when the key key
prometheus api删除某个指定job的所有数据
过度依赖补助,大客户收款难,冲刺“国产数据库第一股”的达梦后劲有多足?
Three. Introduction to JS learning notes 17: mouse control of 3D model rotation of JSON file
Function: JS Click to copy content function
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"?