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.
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.
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(),
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%
Execute following command to update your database
app/console doctrine:schema:update --force
app/console assets:install --symlink --relative
app/console sulu:translate:export
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
Make sure you've set the correct permissions in the Sulu backend for this bundle!
Using varnish have a look at the CSRF documentation.