如何在流明中使用辅助功能? [英] How do I use helper functions in Lumen?

查看:93
本文介绍了如何在流明中使用辅助功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

    $credentials = app_path();

结果:

[Symfony \ Component \ Debug \ Exception \ FatalThrowableError]调用 未定义函数App \ LtClasses \ app_path()

[Symfony\Component\Debug\Exception\FatalThrowableError] Call to undefined function App\LtClasses\app_path()

但是它在此处被列为帮助器: https://laravel.com /docs/5.3/helpers#method-app-path

But it's listed as a helper here: https://laravel.com/docs/5.3/helpers#method-app-path

推荐答案

这些是Laravel文档,您在Lumen上没有相同的帮助程序,可以通过以下链接查看Lumen框架随附的帮助程序.

Those are the Laravel docs, you don't have the same helpers available on Lumen, you can have a look at the helpers that the Lumen framework comes with at

/vendor/laravel/lumen-framework/src/helpers.php

在这里实现您所需的解决方法可能是

Workarounds to achive what you need here could be

app()->path();

app('path');

base_path('app');

这篇关于如何在流明中使用辅助功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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