Skip to content

Latest commit

 

History

History
117 lines (82 loc) · 1.88 KB

README.md

File metadata and controls

117 lines (82 loc) · 1.88 KB

RRule Form

Adds a form type wich creates a rrule-string

use

https://github.com/rlanvin/php-rrule

or

https://github.com/simshaun/recurr

to parse your rrule string

Installation

add ´"whatwedo/rruleform-bundle": "dev-master"´ to ´composer.json´

  "require-dev": {
      "whatwedo/rruleform-bundle": "dev-master"
  },
  "repositories": [
        {
            "type": "vcs",
            "url": "[email protected]:maurizio/rruleFormType.git"
        }
    ]

run composer install

composer install

add FormBundle to bundles.json

    whatwedo\RruleFormBundle\whatwedoRruleFormBundle::class => ['all' => true],

add "@whatwedo/rrule" to packages.json

    "devDependencies": {    
        "@whatwedo/rrule": "file:vendor/whatwedo/rruleform-bundle/Resources/assets"
    }

add theme to twig.yqml

twig:
  form_themes:
    - '@whatwedoRruleForm/form/rrule.html.twig'

add "@whatwedo/rrule" to packages.json

    "devDependencies": {    
        "@whatwedo/rrule": "file:vendor/whatwedo/rruleform-bundle/Resources/assets"
    }

refresh your JavaScript dependencies

    yarn install --force
    npm install --force

add the Rrule to yout stimulus assets/controllers.json

{
    "controllers": {
        "@whatwedo/rrule": {
            "rrule": {
                "enabled": true,
                "fetch": "eager"
            }
        }
    },
    "entrypoints": []
}

add the new form theme in your twig configuration config/packages/twig.yaml

      form_themes:
        - '@whatwedoRruleForm/form/rrule.html.twig'

add the RRule Form type to your Form

public function buildForm(FormBuilderInterface $builder, array $options)
{
    $builder->add('rrule',
        RRuleType::class,
        [
            'label' => 'label.event.rrule',
        ]
    );
}