PHP code example of florentingarnier / spam-protection-bundle
1. Go to this page and download the library: Download florentingarnier/spam-protection-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/ */
florentingarnier / spam-protection-bundle example snippets
// config/bundles.php
return [
// ...
FlorentinGarnier\SpamProtectionBundle\FlorentinGarnierSpamProtectionBundle::class => ['all' => true],
];
use FlorentinGarnier\SpamProtectionBundle\Form\SpamProtectionType;
$builder->add('spam_protection', SpamProtectionType::class, [
'protection_scope' => 'quotation',
'content_fields' => ['message'],
]);
use FlorentinGarnier\SpamProtectionBundle\Form\ChallengeRefresh;
return new JsonResponse([
'error' => $message,
'spamProtection' => ChallengeRefresh::fromFormView($form->createView()['spam_protection']),
], 422);