Skip to content

sulu/SuluFormBundle

Repository files navigation

Form Bundle for Sulu

Simple handling from Symfony Forms in Sulu.io.
You can use this Bundle to create and handle static (integrated in a Sulu page or loaded via AJAX) or dynamic forms.

Features

This Bundle will allow the content manager to create custom forms in the backend which can selected with a content type to be displayed at a specific page.

Also this Bundle handles the problem with the CSRF Token and HTTP Cache.
A simple Controller is provided to handle a Symfony Form with CSRF Token.
The mail dispatching is handled by the bundle.

Installation

Use composer to install this Bundle:

{
    "require": {
        "l91/sulu-form-bundle": "1.0.*"
    }
}

or

composer require l91/sulu-form-bundle:1.0.*

Add to AbstractKernel (app/AbstractKernel.php)

new L91\Sulu\Bundle\FormBundle\L91SuluFormBundle(),

Execute following command to update your database

app/console doctrine:schema:update --force

Config

add the following config to app/config/config.yml

framework:
    esi: { enabled: true } # use to reload csrf token

l91_sulu_form:
    mail_helper:
        from: %parameter_recommended_for_from%
        to: %parameter_recommended_for_to%

Routing

add the following lines to app/config/admin/routing.yml

l91_sulu_form_api:
    type: rest
    resource: "@L91SuluFormBundle/Resources/config/routing_api.yml"
    prefix: /admin/api

Permissions

Make sure you've set the correct permissions in the Sulu backend for this bundle!

Usage