vasily-kartashov/alexa-skills-kit-model
Composer 安装命令:
composer require vasily-kartashov/alexa-skills-kit-model
包简介
Alexa Skill Kit Model
README 文档
README
This is a mapping between Alexa's request and response envelopes and PHP classes. There model library doesn't do any processing and is solely responsible for mapping only.
Reading request envelope
To read a json request execute
$data = json_decode($payload, true); $envelope = RequestEnvelope::fromValue($data);
Writing response envelope
To create a json response use respective builders
$speech = PlainTextOutputSpeech::ofText("Plain text string to speak"); $response = Response::builder() ->withOutputSpeech($speech) ->withShouldEndSession(true) ->build(); $envelope = ResponseEnvelope::builder() ->withVersion("string") ->withResponse($response) ->build(); $payload = json_encode($envelope);
Composer
Use "vasily-kartashov/alexa-skills-kit-model"
ToDo
- Move to
hamlet-framework/alexa-skill-kit-model - Rebuild repository by retrospectively generating all previous versions as well
- Add doc parser https://stackoverflow.com/questions/8504013/how-to-read-javadoc-comments-by-reflection to copy paths
- Use DateTimeImmutable as much as possible
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2018-08-28