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.
composer require sulu/sulu-form-bundle
Add to AbstractKernel (app/AbstractKernel.php)
new Sulu\Bundle\FormBundle\SuluFormBundle(),
Add the following config to app/config/config.yml
framework:
esi: { enabled: true } # use to reload csrf token
sulu_form:
mail_helper:
from: %parameter_recommended_for_from%
to: %parameter_recommended_for_to%
Execute following command to update your database
app/console doctrine:schema:update --force
Add the following lines to app/config/admin/routing.yml
sulu_form_api:
type: rest
resource: "@SuluFormBundle/Resources/config/routing_api.yml"
prefix: /admin/api
Make sure you've set the correct permissions in the Sulu backend for this bundle!