workplacebuddy / adaptive-card
Classes and enums to generate Adaptive Card elements
Installs: 6 733
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ~8.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.64
- nette/php-generator: ^4.1
- phpunit/phpunit: ^10.5
- psalm/plugin-phpunit: ^0.19.0
- symfony/console: ^6.4
- symfony/error-handler: ^6.4
- symfony/event-dispatcher: ^6.4
- symfony/filesystem: ^6.4
- symfony/finder: ^6.4
- symfony/options-resolver: ^6.4
- symfony/process: ^6.4
- symfony/stopwatch: ^6.4
- symfony/string: ^6.4
- symfony/var-dumper: ^6.4
- vimeo/psalm: ^5.26
README
Classes and enums to generate Adaptive Card elements
Definitions are generated from the schema.
Usage
Most of the classes are available in the AdaptiveCard
namespace:
AdaptiveCard/AdaptiveCard
for the main cardAdaptiveCard/Colors
to fiddle with some colors- Etc..
Some more specific elements are in their own namespaces, like the actions and the inputs:
AdaptiveCard\Action\OpenUrl
to open an URL when clickedAdapticeCard\Input\Text
to ask for some text- Etc..
All elements can be found here: https://adaptivecards.io/explorer/, everything should be available -- the elements are generated directly from the manifest/schema.
All elements also have a constructor to quickly create a single element:
For example
$card = new AdaptiveCard\AdapticeCard(); $card->body = [new AdaptiveCard\TextBlock(text: 'Hello world!')]; $card->actions = [ new AdapticeCard\Action\OpenUrl( title: 'Website', url: 'https://www.workplacebuddy.com/', ), ];