Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/valantic/pimcore-forms
https://github.com/valantic/pimcore-forms
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/valantic/pimcore-forms
- Owner: valantic
- Created: 2021-01-27T11:29:15.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-21T11:09:29.000Z (8 months ago)
- Last Synced: 2024-04-14T12:52:19.487Z (7 months ago)
- Language: PHP
- Size: 1.01 MB
- Stars: 4
- Watchers: 9
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pimcore Forms by valantic
[![Latest Version on Packagist](https://img.shields.io/packagist/v/valantic/pimcore-forms.svg?style=flat-square)](https://packagist.org/packages/valantic/pimcore-forms)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![PHP Checks](https://github.com/valantic/pimcore-forms/actions/workflows/php.yml/badge.svg)](https://github.com/valantic/pimcore-forms/actions/workflows/php.yml)**NO support is provided!**
This package is developed by [valantic CEC Schweiz](https://www.valantic.com/en/services/digital-business/) 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`
```yaml
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
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
```php
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
```twig
{% include '@ValanticPimcoreForms/form.html.twig' %}
```### Twig (HTML)
```twig
{% include '@ValanticPimcoreForms/form.html.twig' with {'form': valantic_form_html('contact')} %}
```### Twig (JSON)
```twig
{% include '@ValanticPimcoreForms/form.html.twig' with {'form': valantic_form_json('contact')} %}
```