Home > Backend Development > PHP Tutorial > ThinkPhp中Public公共模板文件内怎么分配数据

ThinkPhp中Public公共模板文件内怎么分配数据

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:07:39
Original
1041 people have browsed it

ThinkPhp中Public公共模板文件内如何分配数据

------解决方案--------------------
???没看明白什么意思
------解决方案--------------------
好像在controller里赋值,可以用的。
如果很多页都用到,就直接在父类的controller里赋值。或使用钩子之类吧
------解决方案--------------------
我以前的解决方案就是在action里面建立一个公共CommonAction.class.php
然后页面都继承它, 这个里面就可以取公共的数据

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Controller does not exist: app\controller\Test
From 1970-01-01 08:00:00
0
0
0
Controller touch?
From 1970-01-01 08:00:00
0
0
0
AngularJS via controller A to controller B
From 1970-01-01 08:00:00
0
0
0
Imitate $this->show() in TP5 Controller
From 1970-01-01 08:00:00
0
0
0
ControllerClass 'think\Controller' not found in
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template