CodeIgniter - 在视图中访问$ config变量 [英] CodeIgniter - accessing $config variable in view

查看:78
本文介绍了CodeIgniter - 在视图中访问$ config变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很多时候我需要访问视图中的 $ config 变量。
我知道我可以将它们从控制器传递给 load-> view()
但是它显然过多。



是否有某种方法或技巧来访问 $ config

$ this-> > config-> item()可以正常工作。


Pretty often I need to access $config variables in views. I know I can pass them from controller to load->view(). But it seems excessive to do it explicitly.

Is there some way or trick to access $config variable from CI views without disturbing controllers with spare code?

解决方案

$this->config->item() works fine.

这篇关于CodeIgniter - 在视图中访问$ config变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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