PHP code example of vasadibt / yii2-protector

1. Go to this page and download the library: Download vasadibt/yii2-protector library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vasadibt / yii2-protector example snippets

           
'bootstrap' => [
    // ...
    'protector',
],
'components' => [
    // ...
    'protector' => [
         'class' => '\vasadibt\protector\ProtectData',
    ],
],

<?= Yii::$app->protector->tel('0036 70 1111 222') 

'protector' => [
    'class' => '\vasadibt\protector\ProtectData',
    'enableAutoDetect' => 'true',
    'autoDetectPatterns' => [ // Optional you can use custom regex list  
        "/[-0-9a-zA-Z.+_]+@[-0-9a-zA-Z.+_]+.[a-zA-Z]{2,4}/U",
        // etc ... 
    ],
    'autoDetectMatchCallback' => function($match){ // Optional, if you want to validate match  
        return $match != '[email protected]';
    },
],

 Yii::$app->protector->enable = false; 

 Yii::$app->protector->debug = true; 

php composer.phar