Skip to content

Commit

Permalink
udpate documentation sfor release 1.0.0-RC1
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Aug 3, 2016
1 parent 4d303d6 commit 4ddc41d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 12 deletions.
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,34 @@ Use composer to install this Bundle:
``` json
{
"require": {
"l91/sulu-form-bundle": "~0.4"
"l91/sulu-form-bundle": "1.0.*"
}
}
```

or

``` bash
composer require l91/sulu-form-bundle:~0.4
```bash
composer require l91/sulu-form-bundle:1.0.*
```

Add to AbstractKernel (app/AbstractKernel.php)

``` php
```php
new L91\Sulu\Bundle\FormBundle\L91SuluFormBundle(),
```

Execute following command to update your database

``` bash
```bash
app/console doctrine:schema:update --force
```

## Config

add the following config to `app/config/config.yml`

``` yml
```yml
framework:
esi: { enabled: true } # use to reload csrf token

Expand All @@ -68,11 +68,8 @@ l91_sulu_form_api:

Make sure you've set the correct permissions in the Sulu backend for this bundle!

## Caching

The Template itself including the form fields should be cached, but not the CSRF Token!

## Usage

- [Static Forms](Resources/doc/static.md "Static Forms")
- [Dynamic Forms](Resources/doc/dynamic.md "Dynamic Forms")

10 changes: 10 additions & 0 deletions Resources/doc/dynamic.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ https://github.com/symfony/symfony/blob/v2.7.0/src/Symfony/Bridge/Twig/Resources
</html>
```

## Theme

```twig
{% block _dynamic_form__token_widget %}
{% set type = type|default('hidden') %}
<input type="{{ type }}" {{ block('widget_attributes') }} value="{{ render_esi(controller('L91SuluFormBundle:Form:token', { 'form': 'dynamic_form' })) }}" /> {# #}
{% endblock _dynamic_form__token_widget %}
```


## Create Form

To create a dynamic form (which is selectable in the property type `form_select`) simply
Expand Down
4 changes: 2 additions & 2 deletions Resources/doc/static.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ https://github.com/symfony/symfony/blob/v2.7.0/src/Symfony/Bridge/Twig/Resources
ClientWebsiteBundle:forms:theme.html.twig:

``` twig
{% block _contact_request__token_widget %}
{% block token_widget %}
{% set type = type|default('hidden') %}
<input type="{{ type }}" {{ block('widget_attributes') }} value="{{ render_esi(controller('L91SuluFormBundle:Form:token', { 'form': 'form_type_alias' })) }}" /> {# #}
{% endblock _contact_request__token_widget %}
{% endblock token_widget %}
```

## E-Mail
Expand Down
22 changes: 22 additions & 0 deletions update/0.4-to-1.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# From 0.4 to 1.0

## Update your composer json file

```json
"l91/sulu-form-bundle": "1.0.*"
```

```bash
composer update l91/sulu-form-bundle
```

## Update database

```bash
app/console doctrine:schema:update --dump-sql --force
```

## Add permissions

For using of the new dynamic form manager feature you need to add your role the permissions.

0 comments on commit 4ddc41d

Please sign in to comment.