kunstmaan/bundles-cms
Kunstmaan CMS is a full-featured, multilingual CMS built on the Symfony full-stack framework. It offers page and form assembly, versioning, workflow, translation tools, and media management, plus integrations with community bundles.
Form pages is an extension of the regular pages with page parts (KunstmaanNodeBundle, KunstmaanPagePartBundle). With the form pages it is possible to create a frontend form which exists out of a mix of form page parts and regular page parts. When the form is submitted a thank you message will be shown, an administrative mail will be sent and a formsubmission will be created.
There are two possibilities to create form pages, you can implement the Kunstmaan\FormBundle\Helper\FormPageInterface or you can extend the Kunstmaan\FormBundle\Entity\AbstractFormPage which has most of the functionality already implemented. To handle the form creation and the submission of the form you can use the kunstmaan_form.form_handler service.
The kunstmaan_form.form_handler uses the kunstmaan_form.form_mailer to sent the administrative mails. It is possible to create your own mailer for this by implementing Kunstmaan\FormBundle\Helper\FormMailerInterface and configuring your new class in the config file kunstmaan_form.form_mailer.class. It is also possible to configure your own FormHandler service by implementing Kunstmaan\FormBundle\Helper\FormHandlerInterface and configuring the class in the config file kunstmaan_form.form_handler.class.
Form page parts are an extension on the regular page parts you can find in the KunstmaanPagePartBundle. With these page parts it is possible to configure a form in the frontend. Form page parts can only be used in collaboration with form pages.
This bundle provides some default page parts you can use. The following configuration options are available for every form page part:
The choice page part can be used to add single or multiple choice form elements to your form. When you add a choice page part to your form you have the following configuration options:
The file upload page part adds the possibility to upload files. When adding a this kind of page part there are a few configuration options available:
There are also a few customizations you can make to specify where you want to upload the submitted files:
The multi-line text page part adds the possibility to add a text area to you forms. The following configuration options are available when adding this page part type:
The single-line text page part can be used to create forms with text input fields. The following configuration options are available when adding this page part type:
This page part type adds the possibility to add submit buttons to your forms. Following configuration options are available when adding this page part type to your form:
It is possible to create your own page parts by extending from Kunstmaan\FormBundle\Entity\PageParts\AbstractFormPagePart. When doing this there are a few methods you need to implement:
public function adaptForm(FormBuilderInterface $formBuilder, ArrayObject $fields);
The adaptForm function is used to add the necessary fields to the form used in the frontend. When adding fields to the form there are a few types of fields you can choose from:
This is also the place to add validation to the form.
public function getDefaultView()
This function needs to return the path to the view for this page part, in this view you can access the created form view by using the frontendform variable. You can also access the form object by using the frontendformobject variable.
public function getDefaultAdminType()
This function needs to return a class that extends Symfony\Component\Form\AbstractType and is used for the configuration of the page part in the backend.
How can I help you explore Laravel packages today?