You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**APL Support**: Alexa Presentation Language (directives, documents, components, commands, gestures) now supported for building multimodal experiences.
// Result: <speak>Welcome to our cooking skill! <breakstrength="medium" /> Today we will learn about <emphasislevel="strong">amazing</emphasis> pasta recipes. <breaktime="2s" /> Let's get started!</speak>
163
164
```
164
165
166
+
## 🖼 APL (Alexa Presentation Language)
167
+
168
+
Build multimodal experiences with the included APL directive, component, command, and gesture classes:
169
+
170
+
```php
171
+
<?php
172
+
173
+
use MaxBeckers\AmazonAlexa\Response\Directives\APL\RenderDocumentDirective;
174
+
use MaxBeckers\AmazonAlexa\Response\Response;
175
+
use MaxBeckers\AmazonAlexa\ResponseHelper;
176
+
177
+
// Inside a request handler:
178
+
$document = [
179
+
'type' => 'APL',
180
+
'version' => '1.8',
181
+
'mainTemplate' => [
182
+
'items' => [
183
+
[
184
+
'type' => 'Text',
185
+
'text' => '${payload.data.message}',
186
+
'style' => 'textStylePrimary1'
187
+
]
188
+
]
189
+
],
190
+
];
191
+
192
+
$dataSources = [
193
+
'data' => [
194
+
'message' => 'Hello from APL!'
195
+
],
196
+
];
197
+
198
+
$aplDirective = new RenderDocumentDirective(
199
+
token: 'mainScreen',
200
+
document: $document,
201
+
datasources: $dataSources
202
+
);
203
+
204
+
// Using the response helper (if available in your handler base)
You can also leverage the rich PHP class model (components, commands, gestures, layouts) instead of raw arrays for stronger typing when building complex documents.
217
+
165
218
## 📍 Device Address Information
166
219
167
220
Access user location data with proper permissions:
0 commit comments