PHP code example of dario_swain / re-captcha-validator
1. Go to this page and download the library: Download dario_swain/re-captcha-validator 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/ */
dario_swain / re-captcha-validator example snippets
php
namespace AcmeBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class ContactType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('message', 'textarea')
/** In type add your form alias **/
->add('captcha', 'ds_recaptcha', array('mapped' => false))
->add('send', 'submit');
}
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
/** This option is