workplacebuddy / adaptive-card
Classes and enums to generate Adaptive Card elements
Installs: 3 485
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 1
Requires
- php: ~8.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.26
- nette/php-generator: ^4.0
- phpunit/phpunit: ^9.5
- psalm/plugin-phpunit: ^0.18.3
- symfony/console: ^6.1
- symfony/error-handler: ^6.1
- symfony/filesystem: ^6.1
- symfony/string: ^6.1
- symfony/var-dumper: ^6.1
- vimeo/psalm: ^4.30
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 static method to quickly create a single element:
make
.
For example
$card = new AdaptiveCard\AdapticeCard(); $card->body = [AdaptiveCard\TextBlock::make(text: 'Hello world!')]; $card->actions = [ AdapticeCard\Action\OpenUrl::make( title: 'Website', url: 'https://www.workplacebuddy.com/', ), ];