PHP code example of lzhy / yw7

1. Go to this page and download the library: Download lzhy/yw7 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lzhy / yw7 example snippets


//site.php
use Lzhy\Yw7\Boot;

defined('IN_IA') or exit('Access Denied');
ame,$arguments)
    {
        $boot = new Boot($name,$arguments);
        $boot->start();
    }
}

Assist::globalVal('key','default-value');//获取或设置全局变量$_W

Assist::gpcVal('key','default-valut');//获取全局$_GPC

//默认会过滤掉微擎添加变量('c','a','eid','version_id','m','do','i','menu_fold_tag:platform','state','op','message','jsMenuScroll','menu_fold_tag:platform_module_menu')和下划线开头的变量,如需过滤更多可以传入第二个参数
Assist::filterParam(['test'=>1,'_test'=>2],['_test']);//['test'=>1] 过滤参数

Assist::gWebUrl('index/index');//生成后台管理链接

Assist::gMobileUrl('index/index'); //生成web端访问链接

Wechat::auth2('userinfo');//微信授权

Wechat::getAccessToken();//公众号accesstoken

Wechat::componentAccessToken();//开放平台accesstoken