laravel基本路径 [英] laravel base path

查看:74
本文介绍了laravel基本路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用URL :: base();然后我得到这个URL:

Im using URL::base(); and I get this URL:

http://www.kp.com.mx/sis_colgate/public

但是我需要的是完整的路径:

but what I need is this complete path:

/home/belendez/public_html/sis_colgate/public

有人知道我怎么走那条路吗?谢谢

Does anybody knows how can I get that path? Thanks

推荐答案

您要使用的是 path 助手.

URL帮助程序用于生成HTTP URL.

The URL helper is for generating HTTP URLs.

尝试使用Laravel 3中的 path('public')函数,

Try the path('public') function in Laravel 3,

或Laravel 4中的 public_path()函数.

or the public_path() function in Laravel 4.

更新了Laravel 4的答案,谢谢艾琳(Erin)

Updated with answer for Laravel 4, thanks Erin

这篇关于laravel基本路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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