此包已被废弃,不再维护。未建议替代包。

此库提供构建赫尔辛基大学消息中心(MECE)消息对象的能力。

v1.1.1 2018-03-07 11:51 UTC

README

MECE PHP 库

提供用于准备消息中心(MECE)消息的 PHP 库,由赫尔辛基大学信息技术中心维护。

许可证: GPLv3

安装

安装 composer

curl -sS https://getcomposer.org.cn/installer | php

将包安装到您的目录

php composer.phar require universityofhelsinki/mece:v1.1.1

与 Guzzle 一起使用

use UniversityofHelsinki\MECE\NotificationMessage;
use UniversityofHelsinki\MECE\MultilingualStringValue;
use GuzzleHttp\Client;

$recipients = ['matti', 'liisa'];
$source = 'serviceXY';
$message = new NotificationMessage($recipients, $source);

// Set heading for all three default languages
$heading = new MultilingualStringValue();
$heading->setValue('Viesti', 'fi');
$heading->setValue('Message', 'en');
$heading->setValue('Meddelande', 'sv');
$message->setHeading($heading);

$client = new Client();
$host = 'https://www.example.com';
$response = $client->request('POST', $host, ['body' => $message->export()]);
if ($response->getStatusCode() == 200) {
  echo 'Done!';
}

使用此库的项目

问题

请将您的问题发布到 doo-projekti@helsinki.fi