CodeIgniter - accessing $config variable in view

后端 未结 11 1076
青春惊慌失措
青春惊慌失措 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:41

    Your controller should collect all the information from databases, configs, etc. There are many good reasons to stick to this. One good reason is that this will allow you to change the source of that information quite easily and not have to make any changes to your views.

提交回复
热议问题