Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Latest commit

 

History

History
101 lines (68 loc) · 2.04 KB

index.md

File metadata and controls

101 lines (68 loc) · 2.04 KB

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(),

Config

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

framework:
    esi: ~  # use to reload csrf token
    fragments: ~

l91_sulu_form:
    mail_helper:
        from: %sulu_admin.email%
        to: %sulu_admin.email%

Create Database

Execute following command to update your database

app/console doctrine:schema:update --force

Install assets

app/console assets:install --symlink --relative

Generate translations

app/console sulu:translate:export

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

Additional form fields

Varnish

Using varnish have a look at the CSRF documentation.