jostkleigrewe / alexa-core-bundle
AlexaCoreBundle for the Symfony Framework
dev-master
2021-10-08 07:38 UTC
Requires
- php: ^8.0.0
- jms/serializer-bundle: ^4.0.0
- jostkleigrewe/intent-core-bundle: dev-develop
- jostkleigrewe/lib-ssml: dev-develop
- symfony/framework-bundle: ^5.0
- symfony/orm-pack: dev-main
This package is auto-updated.
Last update: 2024-09-26 15:37:03 UTC
README
使用 Symfony Flex 的应用程序
打开命令行,进入您的项目目录并执行
$ composer require jostkleigrewe/alexa-core-bundle
不使用 Symfony Flex 的应用程序
步骤 1:下载包
打开命令行,进入您的项目目录并执行以下命令以下载此包的最新稳定版本
$ composer require jostkleigrewe/alexa-core-bundle
此命令要求您全局安装了 Composer,具体请参阅 Composer 文档中的安装章节。
步骤 2:启用包
然后,通过将其添加到项目中 app/AppKernel.php
文件中注册的包列表来启用包。
<?php // app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new Jostkleigrewe\AlexaCoreBundle\JostkleigreweAlexaCoreBundle(), ); // ... } // ... }
创建一个新意图
意图是标记为意图的服务类。
### 创建一个新意图 要创建一个处理意图的新服务,请创建一个新的类,它扩展了 "Jostkleigrewe\AlexaCoreBundle\Intent\AbstractIntent"。
<?php declare(strict_types = 1); namespace App\Intent; use Jostkleigrewe\AlexaCoreBundle\Intent\AbstractIntent; /** * Class DoSomething */ class DoSomething extends AbstractIntent { /** * @return bool */ public function createResponse() { // ... return true; } }