CodeIgniter - accessing $config variable in view

后端 未结 11 1075
青春惊慌失措
青春惊慌失措 2020-12-23 12:52

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 i

11条回答
  •  一生所求
    2020-12-23 13:24

    You can do something like that:

    $ci = get_instance(); // CI_Loader instance
    $ci->load->config('email');
    echo $ci->config->item('name');
    

提交回复
热议问题