首页 > Web开发 > 详细

thinkphp3.1.3中widget用法

时间:2014-11-10 11:29:51      阅读:288      评论:0      收藏:0      [点我收藏+]

今天搞了tp3.1的widget,继承了widget类,但是老是掉用错误,所以换种写法,直接继承action

TestAction.class.php

1 $this->display();//调用模板
2 
3 Group/Home/Widget/TestWidget.class.php
4 
5 class TestWidget extends Action{
6 public function hello($name=”){
7 echo (“hello,”.$name.”!”);
8 }
9 }

 

在模板文件中,调用该挂件

<?php

A(‘Test’,‘Widget’)->hello(‘world’);

?>

 

搞不懂手册上的{:W(‘Cate/Menu‘)},没有显示。所以琢磨了以上做法。R方法感觉也有点问题,所以用A代替。

thinkphp3.1.3中widget用法

原文:http://www.cnblogs.com/findgor/p/4086529.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!