lionar/messages

lionar消息的基本规则。

dev-master 2017-04-05 21:10 UTC

This package is not auto-updated.

Last update: 2024-09-14 19:52:58 UTC


README

Lionar消息提供了一层安全层,用于创建有效的消息。当使用此包时,以下验证规则将自动应用。

验证规则

  • 一段文本最多包含140个字符
  • 标题最多包含70个字符
  • 消息内部提供的任何HTML都将自动使用htmlentities转义

用法

use Messages\Message;
use Messages\Paragraph;
use	Messages\Text;

require __DIR__ . '/vendor/autoload.php';

$text = new Text;
$paragraph = new Paragraph;

$paragraph->with( $text( 'Our new site is online, go take a look: http://eyedouble.nl' ) );

$message = new Message( $paragraph );

echo $message->body; // 'Our new site is online, go take a look: http://eyedouble.nl'