Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
rodber committed Jan 8, 2024
1 parent fd050a0 commit aea918a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/message.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,28 @@ composer require chevere/message

Use function `message` to create a Message by passing the message template. Use named named arguments to define replacement pairs.

Supported tags:

* %tag%
* {{tag}}
* {{ tag }}

```php
use function Chevere\Message\message;

$message = message(
'Hello, **%tag%**!',
'Hello, %tag%!',
tag: 'World'
);
```

🪄 Message supports `%tag%`, `{{tag}}` and `{{ tag }}` replacement template tags.

## To string

The `__toString` method return the message with translated placeholders.

```php
$message->__toString();
// Hello, **World**!
// Hello, World!
```

## Utility methods
Expand All @@ -45,8 +49,8 @@ $message->__toString();
Use `template` method to return the message template.

```php
$message->replacements();
// Hello, **%tag%**!
$message->template();
// Hello, %tag%!
```

### Replacements
Expand Down

0 comments on commit aea918a

Please sign in to comment.