PHP code example of sithous / antispam-bundle
1. Go to this page and download the library: Download sithous/antispam-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/ */
sithous / antispam-bundle example snippets
php composer.phar update
php app/console doctrine:schema:update --dump-sql
public function submitVoteAction(Request $request)
{
// somewhere in your code...
$spamCheck = $this->get('sithous.antispam');
if(!$spamCheck->setType('vote_protection')->verify())
{
return new JsonResponse(array(
'result' => 'error',
'message' => $spamCheck->getErrorMessage()
));
}
}