Skip to content

Latest commit

 

History

History
19 lines (17 loc) · 674 Bytes

symfony-usage.md

File metadata and controls

19 lines (17 loc) · 674 Bytes

Basic Usage in Symfony

If you followed the Setup you will have a bunch of services registered. For the Basic-Usage you only need the Client to execute all the Actions the Client has implemented.

# AcmeBundle/IndexController.php
public function messageAction()
{
    $client   = $this->get('dz.slack.client');
    $response = $client->send(
        \DZunke\SlackBundle\Slack\Client\Actions::ACTION_POST_MESSAGE,
        [
            'identity' => $this->get('dz.slack.identity_bag')->get('CoffeeBrewer'),
            'channel'  => '#slack-testing',
            'text'     => 'Good Morning, please make sure u got a coffee before working!'
        ]
    );
}