Developed with love by KnpLabs Hire us for your project!
23

KPhoenContactBundle

by K-Phoen

Yet another contact bundle

KPhoenContactBundle

Build Status

Yet another contact bundle.

Installation

Composer

Add kphoen/contact-bundle to your required field. Then install/update your
dependencies.

app/AppKernel.php

Register the KPhoenContactBundle:

# 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:

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:

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.

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.

In app/Resources/KPhoenContactBundle/views/Contact/contact.html.twig:

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

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

{% block body %}
<h2>Contact</h2>

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

Events

Two events are emitted during the submission of the event form:

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

License

MIT. See the LICENSE file.

k_phoen_contact:
to: ~
redirect_url: homepage
  • Merge pull request #2 from pretor/2.0.1
    By K-Phoen, 2 years ago
  • add Serbian translations
    By , 2 years ago
  • Improve travis-ci config
    By K-Phoen, 2 years ago
  • Small typo in the readme
    By K-Phoen, 2 years ago
  • Typo in the readme
    By K-Phoen, 3 years ago
  • Added more docs
    By K-Phoen, 3 years ago
  • Updated the readme
    By K-Phoen, 3 years ago
  • Reworked controllers
    By K-Phoen, 3 years ago
  • Extracted the mail sending logic to a form handler
    By K-Phoen, 3 years ago
  • Rewrote the bundle to be more extensible (event based, ability to use different strategies to determine the sender and receiver, use templates for mail bodies)
    By K-Phoen, 3 years ago
  • Test against PHP 5.5
    By K-Phoen, 3 years ago
  • Add: phpunit to the dev requirements
    By K-Phoen, 3 years ago
  • Add: Symfony 2.3 support (fixes #1)
    By K-Phoen, 3 years ago
  • Fix: modified requirements to allow symfony versions >=2.1
    By K-Phoen, 3 years ago
  • Typo in the readme
    By K-Phoen, 4 years ago
  • Add: english translations
    By K-Phoen, 4 years ago
  • Fix: translation configuration in tests
    By K-Phoen, 4 years ago
  • Add: translations for templates and form
    By K-Phoen, 4 years ago
  • Chg: remove the image from the form template
    By K-Phoen, 4 years ago
  • Fix: code coverage configuration
    By K-Phoen, 4 years ago
  • Add: build status icon
    By K-Phoen, 4 years ago
  • Add: travis ci configuration file
    By K-Phoen, 4 years ago
  • Add: tests
    By K-Phoen, 4 years ago
  • Add: gitignore file
    By K-Phoen, 4 years ago
  • Fix: contact view
    By K-Phoen, 4 years ago
  • Add: readme file
    By K-Phoen, 4 years ago
  • Chg: define routes in a configuration file instead of using annotations
    By K-Phoen, 4 years ago
  • Add: composer.json
    By K-Phoen, 4 years ago
  • Add: licence file
    By K-Phoen, 4 years ago
  • Add: initial import
    By K-Phoen, 4 years ago