GithubHelp home page GithubHelp logo

k-phoen / kphoencontactbundle Goto Github PK

View Code? Open in Web Editor NEW
7.0 6.0 4.0 120 KB

Yet another contact bundle

Home Page: http://k-phoen.github.io/KPhoenContactBundle/

License: MIT License

PHP 93.95% HTML 6.05%

kphoencontactbundle's Introduction

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: '[email protected]' }
    receiver:           { address: '[email protected]' }

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.

kphoencontactbundle's People

Contributors

zapashcanon avatar k-phoen avatar alister avatar pretor avatar

Stargazers

 avatar  avatar  avatar Thibaut Salanon avatar Pierre Tachoire avatar Cyrille avatar Nikola Petkanski avatar

Watchers

 avatar  avatar James Cloos avatar  avatar Amira Bedhiafi avatar  avatar

kphoencontactbundle's Issues

symfony 2.3 support

Several methods were deprecated starting symfony 2.1 and are going to be removed as of 2.3.

I've noticed some of them still being part of the code of this bundle and this concerns me.

We are building a fresh application which is going to use the symfony cmf, which would be based on symfony 2.3.

Would it be possible to start a tag compatible with the upcoming 2.3 release?

deprecated config/code

The "_method" requirement of route "contact_send" in file ".../kphoen/contact-bundle/Resources/config/routing.yml" is deprecated since version 2.2 and will be removed in 3.0. Use the "methods" option instead

KPhoen\ContactBundle\Form\Type\MessageType: The FormTypeInterface::getName() method is deprecated since version 2.8 and will be removed in 3.0. Remove it from your classes. Use getBlockPrefix() if you want to customize the template block prefix. This method will be added to the FormTypeInterface with Symfony 3.0

FrameworkExtraBundle limited to v3.0

The only use appears to be a @Template annotation on one controller action. Allowing "^3.0|^4.0|^5.0" should be safe, and longer-term, using the render() results directly as a return would allow the removal of the FrameworkExtraBundle entirely.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.