开发者

CodeIgniter Template Library

开发者 https://www.devze.com 2023-04-07 04:20 出处:网络
I am using CodeIgniter with Template Library and have set up my template view file. Part of my template that doesn\'t change from page to page displays data from a database.

I am using CodeIgniter with Template Library and have set up my template view file. Part of my template that doesn't change from page to page displays data from a database.

What is the best way to includ开发者_如何学运维e this data in my template?


If the content doesn't change very often, something like the user's name, I would store it in the session and call it from there. Otherwise, if you really need to query it on every page request, I would create a base controller (MY_Controller) then create and assign a protected var that you can access from your controllers.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号