PHP code example of isometriks / spam-bundle

1. Go to this page and download the library: Download isometriks/spam-bundle 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/ */

    

isometriks / spam-bundle example snippets


// config/bundles.php

return [
    // ...
    Isometriks\Bundle\SpamBundle\IsometriksSpamBundle::class => ['all' => true],
];

$this->createForm(MyType:class, null, [
    'timed_spam' => true, // Just this line is ease wait 3 seconds before submitting',
]);

public function configureOptions(OptionsResolver $resolver)
{
    $resolver->setDefaults([
        'timed_spam' => true,
        // ...
    ]);
}

// Only honeypot = true is class, null, [
    'honeypot' => true,
    'honeypot_field' => 'email_address',
    'honeypot_use_class' => false,
    'honeypot_hide_class' => 'hidden',
    'honeypot_message' => 'Form fields are invalid',
]);

public function configureOptions(OptionsResolver $resolver)
{
    $resolver->setDefaults([
        'honeypot' => true,
        // ...
    ]);
}