PHP code example of assayer-pro / yii2-cspreport

1. Go to this page and download the library: Download assayer-pro/yii2-cspreport 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/ */

    

assayer-pro / yii2-cspreport example snippets


    'modules' => [
        'csp-report' => [
            'class' => 'assayerpro\cspreport\Module',
            'message' => [
                'from' => '[email protected]',
                'to' => '[email protected]',
                'subject' => 'Content Security Policy Report',
            ],
        ],
    ],

    'components' => [
    ...
        'urlManager' => [
            'rules' => [
                'csp-report' => 'csp-report/report/index',
            ],
        ],
    ...
    ],

    'components' => [
    ...
        'request' => [
            'parsers' => [
                'application/csp-report' => 'yii\web\JsonParser',
            ],
        ],
    ...
    ],

php composer.phar