victoire/form-widget

This package is abandoned and no longer maintained. No replacement package was suggested.

Victoire Form widget

Installs: 3 842

Dependents: 0

Suggesters: 0

Security: 0

Stars: 5

Watchers: 15

Forks: 8

Open Issues: 3

Type:symfony-bundle

2.3.7 2018-08-13 14:41 UTC

This package is auto-updated.

Last update: 2021-12-21 22:51:50 UTC


README

CircleCI

Victoire Form Bundle

What is the purpose of this bundle

This bundle gives you access to the Form Widget. With this widget, you can install any contact form.

Set Up Victoire

If you haven't already, you can follow the steps to set up Victoire here

Install the Bundle :

Run the following composer command :

php composer.phar require victoire/form-widget

Do not forget to add the bundle in your AppKernel!

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            ...
            new Victoire\Widget\FormBundle\VictoireWidgetFormBundle(),
            new Ivory\CKEditorBundle\IvoryCKEditorBundle(),
        );

        return $bundles;
    }
}

Inject Data before send mail

When widget is configure to send mail with form data, you can inject some other data before send mail.

Create a EventLister :

<?php
namespace AppBundle\EventListener;

use Symfony\Component\EventDispatcher\Event;

class WidgetFormListener
{
    public function injectData(Event $event)
    {
        $event->prependData('new label', 'before post data');
        $event->appendData('another label', 'after post data');
    }
}

Declare listener in Service :

#service.yml

widget_form_listener:
    class: AppBundle\EventListener\WidgetFormListener
    tags:
        - { name: kernel.event_listener, event: victoire.widget_form.pre_send_mail, method: injectData }

Use reCAPTCHA

ReCAPTCHA is a free CAPTCHA service that protects websites from spam and abuse.

Parameters

To use reCAPTCHA on your website, you'll need to :

    victoire_widget_form.recaptcha_public_key: XXXXXX
    victoire_widget_form.recaptcha_private_key: XXXXXX