Download the PHP package singlequote/laravel-text-parser without Composer
On this page you can find all versions of the php package singlequote/laravel-text-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download singlequote/laravel-text-parser
More information about singlequote/laravel-text-parser
Files in singlequote/laravel-text-parser
Package laravel-text-parser
Short Description A package to replace words in a text with values from a array. Also supports aliases and excluded properties
License MIT
Homepage https://github.com/SingleQuote/laravel-text-parser
Informations about the package laravel-text-parser
An easy laravel text parser
A package to replace words in a text with values from a array. Also supports aliases and excluded properties.
Installation
You can install the package via composer:
Basic Usage
Using arrays as values
will generate FooBar - [email protected]
Available methods
All methods can be chained together like text()->values()->aliases()
and can be in any order.
But you always have to start with the text()
function.
text
This sets the string you want to parse
values
This sets the values to use while parsing. Must be a array
tags
Tags are the characters around the keys you want to parse. Default [
and ]
exclude
Sets the keys which are excluded from parsing
aliases
Sets the aliases. Aliases can be used to map a value to a different name.
So for example you can set the aliases to ['name' => 'username']
to map username
to name
parse
Parses the text and returns the parsed string
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Quotec
- All Contributors
License
The MIT License (MIT). Please see License File for more information.