Of course I know it's for Label, but the column of the head is taken out from the database, before the reuse of the most is also the view reuse, the column is not reusable, do you want to each controller inside the column out?
Reply content:
I certainly know is to use the label, but the column of the head is taken out from the database, before the kind of reuse is also the view reuse, the column is not reusable, do you want to each controller inside the column out?
You go to the header page to read the database, and then the header include to index not good.
With the TP pendant, directly call the pendant just fine
All classes inherit a core-written class, then query within the class, then $this->assign (' data ', $data);
所有controller继承一个 在commoncontroller里的构造方法写入你的查询需求即可
如果有方法临时不需要这个查询的话可以在子类中重新定义构造方法
建议模板插件用smarty,不要用tp自己的。
用block模板布局啊。固定头部和尾部。内容页继承就完事了。官方文档里面也有吧http://document.thinkphp.cn/manual_3_2.html#template_extend
或者你自己用前端框架来实现也可以。通过异步请求来加载内容页。
我们采用的是异步请求。简单粗暴。