https://github.com/beastbytes/yii2-emailobfuscator
Yii2 Widget to obfuscate email addresses
https://github.com/beastbytes/yii2-emailobfuscator
Last synced: 2 months ago
JSON representation
Yii2 Widget to obfuscate email addresses
- Host: GitHub
- URL: https://github.com/beastbytes/yii2-emailobfuscator
- Owner: beastbytes
- License: other
- Created: 2015-07-27T14:55:19.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-07-27T15:37:09.000Z (almost 10 years ago)
- Last Synced: 2025-02-03T15:55:02.064Z (4 months ago)
- Language: PHP
- Size: 133 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# yii2-emailobfuscator
Yii2 Widget to obfuscate email addresses to help prevent harvesting by spam bots.The widget outputs either a message or an obfuscated version of the address as
the text into the document. If JavaScript is enabled that text is replaced with
a _mailto_ link.For license information see the [LICENSE](LICENSE.md) file.
## Installation
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
php composer.phar require --prefer-dist beastbytes/yii2-microformats
```or add
```json
"beastbytes/yii2-emailobfuscator": "~1.0.0"
```to the require section of your composer.json.
## Usage
Use this extension in a view.
To output the default message ("This e-mail address is protected to prevent harvesting by spam-bots")
```php
$emailAddress = EmailObfuscator::widget([
'address' => '[email protected]'
]);
```To output the email address as an obfuscated version: "my dot address at example dot com"
```php
$emailAddress = EmailObfuscator::widget([
'address' => '[email protected]',
'obfuscators' => [' dot ', ' at ']
]);
```