Thanks to visit codestin.com
Credit goes to github.com

Skip to content

valantic/pimcore-forms

Repository files navigation

Pimcore Forms by valantic

Latest Version on Packagist Software License PHP Checks

NO support is provided!

This package is developed by valantic CEC Schweiz and is under active development.

Setup

composer require valantic/pimcore-forms

Then, activate the bundle in the Pimcore Admin UI.

Usage

Configuration: app/config/forms.yml

valantic_pimcore_forms:
  forms:
    contact:
      outputs:
        mail:
          type: email
          options:
            to: [email protected]
            document: /system/emails/
        pimcore_object:
          type: data_object
          options:
            class: ContactFormSubmission
            path: '/Forms'
      fields:
        name:
          type: TextType
          options:
            label: Name
          constraints:
            - NotBlank
        email:
          type: EmailType
          options:
            label: Email
          constraints:
            - NotBlank
            - Email
        message:
          type: TextareaType
          options:
            label: Message
          constraints:
            - NotBlank
            - Length:
                min: 20
        submit:
          type: SubmitType

Areabrick

An Areabrick is provided for use in CMS documents.

Controller + Twig

Action

public function contactAction(\Valantic\PimcoreFormsBundle\Service\FormService $formService): \Symfony\Component\HttpFoundation\Response
{
    return $this->render('contact_form.html.twig', [
        'form' => $formService->buildForm('contact')->createView(),
    ]);
}

Twig

{% include '@ValanticPimcoreForms/form.html.twig' %}

Twig (HTML)

{% include '@ValanticPimcoreForms/form.html.twig' with {'form': valantic_form_html('contact')} %}

Twig (JSON)

{% include '@ValanticPimcoreForms/form.html.twig' with {'form': valantic_form_json('contact')} %}

License

In order to comply with Pimcore's updated licensing policy, this bundle is (now) published under the GPLv3 license for compatibility Pimcore Platform Version 2024.4 and will be re-licensed under the POCL license as soon as it is compatible with Pimcore Platform Version 2025.1.

If you have any questiosn regarding licensing, please reach out to us at [email protected].

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •