yii2-emailobfuscator
Yii2 Widget to obfuscate email addresses to help prevent harvesting by spam bots., (*1)
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., (*2)
For license information see the LICENSE file., (*3)
Installation
The preferred way to install this extension is through composer., (*4)
Either run, (*5)
php composer.phar require --prefer-dist beastbytes/yii2-microformats
or add, (*6)
"beastbytes/yii2-emailobfuscator": "~1.0.0"
to the require section of your composer.json., (*7)
Usage
Use this extension in a view., (*8)
To output the default message ("This e-mail address is protected to prevent harvesting by spam-bots"), (*9)
$emailAddress = EmailObfuscator::widget([
'address' => 'my.address@example.com'
]);
To output the email address as an obfuscated version: "my dot address at example dot com", (*10)
$emailAddress = EmailObfuscator::widget([
'address' => 'my.address@example.com',
'obfuscators' => [' dot ', ' at ']
]);