PHP code example of mpp / message-bundle
1. Go to this page and download the library: Download mpp/message-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mpp / message-bundle example snippets
//...
use Mpp\MessageBundle\Provider\MessageProvider;
//...
protected MessageProvider $messageProvider;
//...
public function __construct(MessageProvider $messageProvider)
{
$this->messageProvider = $messageProvider;
}
//...
// In a function where you want to send message
$transportOptions = [];
$contents = [];
$this->messageProvider->send('message_1', $transportOptions, $contents);
//...
yaml
mpp_message:
resource: "@MppMessageBundle/Controller/*.php"
type: annotation
prefix: /test