承接 matryoshka-app/sdk-php-core 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

matryoshka-app/sdk-php-core

Composer 安装命令:

composer require matryoshka-app/sdk-php-core

包简介

SDK core on php. Can be used to embed in your favorite framework.

README 文档

README

SDK core on php for create backend side for your matreshka app. Can be used to embed in your favorite framework.

Start

composer require matryoshka-app/sdk-php-core

Run

You should call Matryoshka\Matryoshka->start() for start app. example:

$matryoshka = new Matryoshka();
$response = $matryoshka->start();
echo $response;

Handlers

Handlers extended Matryoshka\Handlers\Handler abstract class. You should set uri and handler for you handler. You can use uri system for easy understanding how to use the payload.

Example:

class MockHandler extends Handler {
    static function getURI() {
        return 'test/1';
    }

    function handler() {
        $menuItem = new MenuItem();
        $menuItem->title = new Text('test');
        
        $response = $this->getResponse();
        $response->menu->add($menuItem);
        $response->addWidget(new Text('testim'));
    }
}

On example below we created new handler and declared required methods getURI() and handler(). getURI() - should return uri string. handler() - your logic and build response for reply.

Now you should add new handlers for you requests. Handlers need be registered on sdk.

$matryoshka->getHandlerManager()->addHandler(SomeHandler::class);

URI - contained payload parameter according http uri interface.

  • You can use url and query string /users/profile?id=2&full_profile=true after '?'
  • You can pass for you handler as http request. You can get it on you handler $this->getRequest()->uri and array query string $this->getRequest()->query.
  • Or you can use full payload content on $this->getRequest()->payload.

Links

Matryoshka API Docs

Example framework on php using this sdk

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固