codecamp

插件类主文件

插件类主文件

上一页下一页

插件类主文件

文件位于插件根目录

命名格式:插件名+Plugin.class.php

<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2014 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: Dean <zxxjjforever@163.com>
// +----------------------------------------------------------------------
namespace plugins\Demo;//Demo插件英文名,改成你的插件英文就行了
use Common\Lib\Plugin;

/**
 * Demo
 */
class DemoPlugin extends Plugin{//Demo插件英文名,改成你的插件英文就行了

        public $info = array(
            'name'=>'Demo',//Demo插件英文名,改成你的插件英文就行了
            'title'=>'插件演示',
            'description'=>'插件演示',
            'status'=>1,
            'author'=>'ThinkCMF',
            'version'=>'1.0'
        );
        
        public $has_admin=1;//插件是否有后台管理界面

        public function install(){//安装方法必须实现
            return true;//安装成功返回true,失败false
        }

        public function uninstall(){//卸载方法必须实现
            return true;//卸载成功返回true,失败false
        }
        
        //实现的footer钩子方法
        public function footer($param){
            $config=$this->getConfig();
            $this->assign($config);
            $this->display('widget');
        }

    }

上一页下一页

插件配置文件
插件开发流程
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

后台管理

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }