- 路径如下
-
1 <?php 2 3 /** 4 * @encoding UTF-8 5 * @author laifei 6 * @datetime 2017-5-25 16:27:48 7 * @version 1.0 8 * @Description 9 */ 10 11 namespace Admin\Widget; 12 use \Think\Controller; 13 class CateWidget extends Controller{ 14 public function getAdminUser(){ 15 echo "admin"; 16 } 17 }
- 在模板中用W方法调用:
{:W('Cate/getAdminUser')} 模板中则会输出admin - 常见地点:用于左侧菜单获取常用此类方法