2017 © Pedro Peláez
 

symfony-bundle contact-bundle

Yet another contact bundle

image

kphoen/contact-bundle

Yet another contact bundle

  • Sunday, December 3, 2017
  • by K-Phoen
  • Repository
  • 4 Watchers
  • 9 Stars
  • 2,620 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 3 Open issues
  • 13 Versions
  • 1 % Grown

The README.md

KPhoenContactBundle

Build Status StyleCI Coverage Status Latest stable release Overall downloads on Packagist license, (*1)

Yet another contact bundle., (*2)

Installation

Composer

Add kphoen/contact-bundle to your required field. Then install/update your dependencies., (*3)

app/AppKernel.php

Register the KPhoenContactBundle:, (*4)

# app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new KPhoen\ContactBundle\KPhoenContactBundle(),
    );
}

Configuration

config.yml

The following options are available in the app/config/config.yml file:, (*5)

k_phoen_contact:
    redirect_url:       homepage  # the url to redirect the user to once the
                                  # mail is sent
    sender:             { address: 'no-reply@foo.org' }
    receiver:           { address: 'contact@foo.org' }

Routing

Import the routes:, (*6)

kphoen_contact:
    resource: "@KPhoenContactBundle/Resources/config/routing.yml"

Usage

Routes

The previous configuration imports a route named contact in your application, which correspond to a simple contact form., (*7)

Templates

You will probably need to customize the view used by the bundle. To do that, we will override the templates exposed by the contact bundle., (*8)

In app/Resources/KPhoenContactBundle/views/Contact/contact.html.twig:, (*9)

{% extends 'AcmeDemoBundle::layout.html.twig' %}

{% block title %}Contact{% endblock %}

{% block body %}


Contact

{% include "KPhoenContactBundle:Contact:form.html.twig" with {'form': form} %} {% endblock %}

Events

Two events are emitted during the submission of the event form:, (*10)

  • contact.pre_send: emitted just before the mail is sent ;
  • contact.post_send: emitted just after.

Contributing

See the CONTRIBUTING file., (*11)

The Versions

05/05 2013
17/12 2012
17/12 2012