Simple handling from Symfony Forms in Sulu.io.
You can use this Bundle to create and handle 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.
Run the following command to install:
composer require sulu/form-bundleEnable the required bundles in the config/bundles.php of your project:
Sulu\Bundle\FormBundle\SuluFormBundle::class => ['all' => true],Configure the default sender and receivers email address (optional):
sulu_form:
mail:
from: "%env(SULU_ADMIN_EMAIL)%"
to: "%env(SULU_ADMIN_EMAIL)%"
sender: "%env(SULU_ADMIN_EMAIL)%"Optional configure the email handler to SwiftMailer (swift_mailer) or the Symfony Mailer (mailer):
sulu_form:
mail:
helper: "swift_mailer" # is defaultExecute the following command to get the sqls to update your database.
php bin/adminconsole doctrine:schema:update --dump-sqlYou can use --force to run the sqls but be carefully which other
sql statements are executed. Its recommended to use DoctrineMigrationsBundle
to update production databases.
Add the following lines to config/routes/sulu_admin.yaml
sulu_form_api:
type: rest
resource: "@SuluFormBundle/Resources/config/routing_api.yml"
prefix: /admin/apiMake sure you've set the correct permissions in the Sulu backend for this bundle!
- Dynamic Forms
- Static Forms (deprecated)