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

KPhoenContactBundle

by K-Phoen

Yet another contact bundle

KPhoenContactBundle

Build Status
StyleCI
Coverage Status
Latest stable release
Overall downloads on Packagist
license

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.

Contributing

See the CONTRIBUTING file.

  • Fix #32 - remove sensio/framework-extra-bundle/@Template
    By , 1 year ago
  • Fix for Symfony 2.8, with an explicit (correct-case) template file
    By zapashcanon, 1 year ago
  • Add KERNEL_DIR for testing Symfony 2.8
    By zapashcanon, 1 year ago
  • Re-add sensio/framework-extra-bundle to enable @Template
    By zapashcanon, 1 year ago
  • Update to Symfony 2.8 min, and add autoload-dev for AppKernel & Tests
    By zapashcanon, 1 year ago
  • PHPunit 5 mocking support and use of KERNEL_CLASS for functional test
    By zapashcanon, 1 year ago
  • Update PHPunit to 5.7, latest PHP5-supporting release
    By zapashcanon, 1 year ago
  • Fixing the travis config
    By zapashcanon, 1 year ago
  • Add the Symfony4 deps for initial tests, incs php 7.1/7.2
    By zapashcanon, 1 year ago
  • Correct the translation key
    By zapashcanon, 2 years ago
  • Symfony 2.8+ deprecates 'intention'
    By zapashcanon, 2 years ago
  • Spelling correction
    By zapashcanon, 2 years ago
  • Fix deprecated method's name
    By zapashcanon, 3 years ago
  • Fix deprecated route
    By zapashcanon, 3 years ago
  • Drop support for PHP < 7.0
    By zapashcanon, 3 years ago
  • Explicit data types
    By zapashcanon, 3 years ago
  • Enable code coverage informations and coveralls (#24)
    By web-flow, 3 years ago
  • Merge pull request #23 from zapashcanon/master
    By web-flow, 3 years ago
  • Add Coverage Status badge
    By zapashcanon, 3 years ago
  • Merge pull request #21 from zapashcanon/master
    By web-flow, 3 years ago
  • Update CONTRIBUTING.md
    By zapashcanon, 3 years ago
  • Merge pull request #20 from zapashcanon/master
    By web-flow, 3 years ago
  • Fix yaml files using the new yamllint config
    By zapashcanon, 3 years ago
  • Merge pull request #19 from zapashcanon/master
    By web-flow, 3 years ago
  • Override yamllint config
    By zapashcanon, 3 years ago
  • Merge pull request #18 from zapashcanon/master
    By web-flow, 3 years ago
  • Fix links in README.md
    By zapashcanon, 3 years ago
  • Merge pull request #17 from K-Phoen/3.0
    By web-flow, 3 years ago
  • Disable email notifications from Travis.
    By web-flow, 3 years ago
  • Merge.
    By zapashcanon, 3 years ago