跨模块和应用程序的语言文件
我只是想了解 FuelPHP 如何跨模块和应用程序目录处理语言文件。它将所有同名的语言合并到一个语言数组中,或者如果它在应用程序中找到它,它会停在那里吗?
如果我要在应用程序和模块中创建 foo.php 语言文件,我是否可以访问这两个文件中的所有内容,还是只能访问应用程序中的内容?
I was just looking to get some clarification on how FuelPHP handles language files across modules and the application directory. Does it merge all of them of the same name into one language array or if it finds it in the application does it just stop there?
If I was to create a foo.php language file in the application and in a module, will I have access to all the stuff in both files or just the one in application?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您位于模块上下文中,Lang::load('foo') 将从模块加载语言文件,并将其与全局“foo”(如果存在)合并。
如果您不在模块上下文中,或者您想从另一个模块(然后是活动模块)加载某些内容,则只需使用 Lang::load('module::foo') 显式指定模块。
If you are in a module context, Lang::load('foo') will load the language file from the module, and will merge it with a global 'foo' if that exists.
You only have to explicitly specify the module using Lang::load('module::foo') if you are not in a module context, or you want to load something from another module then the active module.