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

WBOY
Release: 2016-06-23 13:44:28
Original
925 people have browsed it


回复讨论(解决方案)

???没看明白什么意思

好像在controller里赋值,可以用的。
如果很多页都用到,就直接在父类的controller里赋值。或使用钩子之类吧

我以前的解决方案就是在action里面建立一个公共CommonAction.class.php
然后页面都继承它, 这个里面就可以取公共的数据

嗯,呵呵,非常感谢各位,我已经解决了这个问题,还有一个小问题。


嗯,呵呵,非常感谢各位,我已经解决了这个问题,还有一个小问题。
怎么解决的?

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!