Giter VIP home page Giter VIP logo

miniprogram-lite's Introduction

miniProgram-lite

微信小程序php后端接口轻量版

####初衷: 好用的微信SDK一大堆,已经没有自己写了。
但是好用的SDK大而全,依赖也大。对于业务很小的应用着实有点浪费。
当时业务需求,顺势做小程序,但是实际后端的接口用量很小,所以打算用到的接口自己包一下。
再然后,就打算拆出来分享出来。

##安装:

composer require yingouqlj/wechat-mini-program-lite

##基本使用:

<?php

use Yingou\MiniProgram\MiniProgram;
$config=[
    'appId' => 'appid',
    'secret' => 'secret'
    ];
$program=new MiniProgram($config);
//创建Qrcode
$program->createQrCode->create('/page?id=1',120);

##建议用法: 增加个配置继承Config
在里面实现 token 的读写覆盖原有方法

<?php

class ProgramConfig extends \Yingou\MiniProgram\Config{
    public function getAccessToken()
    {
        //覆盖掉原来的方法在这里 读取token
    }
     public function setAccessToken($token, $expires = 0)
     {
          //覆盖写入 如 redis      
     }   
}

use Yingou\MiniProgram\MiniProgram;
$program=new MiniProgram(new ProgramConfig());
$program->createQrCode->create('/page?id=1',120);

##接口

####进度 先立项,慢慢完善。后面也会考虑引入其他依赖包。第一版是轻巧。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.