Copyright © 2009 by Micha Wotton
All rights reserved.
Dual licensed under the MIT and GPL licenses:
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl.html
Requirements
Installation
- Extract the release file under
protected/extensions
- Add the class as a component in your application's main.php config file.
Config code:
'components'=>array(
...
'obfuscator'=>array(
'class' =>'application.extensions.obfuscator.Obfuscator',
),
...
),
Usage
The class has a single public function: disguise(). This function takes 2 parameters:
- $email (string): The email address to be obfuscated
- $link (bool): Whether the email address should be displayed to the user as a mailto link - default is 'true'
Wherever you want an email address inserted, call the disguise function according to the following examples:
With a mailto link:
<?php echo Yii::app()->obfuscator->disguise('members@winjje.com',true); ?>
Without a link:
<?php echo Yii::app()->obfuscator->disguise('members@winjje.com',false); ?>