ravenberg/uikit-bundle

Use UiKit in Symfony

This package's canonical repository appears to be gone and the package has been frozen as a result.

Installs: 346

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 1

Language:HTML

1.0.4 2016-10-25 20:59 UTC

This package is not auto-updated.

Last update: 2019-11-19 20:03:44 UTC


README

Use UiKit-Forms in Symfony

Requirements

The twig extension leverages the PHP Intl extension. Make sure to have that installed. https://secure.php.net/manual/en/book.intl.php

Installation

First you need to add the package to your composer.json:

Easiest way is to use the command composer require ravenberg/uikit-bundle.

You also need to add RavenbergUiKitBundle to your AppKernel.php

// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
    // ...
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Ravenberg\UiKitBundle\RavenbergUiKitBundle(),
        );
        // ...
        return $bundles
    }
    // ...
}

After that you have to let twig know about the form template. You do this by adding this configuration to config.yml:

twig:
    form_theme:
        - 'RavenbergUiKitBundle::uikit-form.html.twig'

Now to use it in your twig template, add the following in your template: {% form_theme form '@RavenbergUiKit/uikit-form.html.twig' %}

You have to include the UiKit Stylesheets and JavaScripts for yourself. Essentially you also just could download the uikit-form.html.twig and use it witout installing this bundle, note that you have to chnage the date and time widgets to not use the localizeddateformat function and supply you own format for the uikit-date- and -timepicker.

The UiKit Components you need to include at least are these

  • form-select
  • form-password
  • form-file
  • form-advanced
  • placeholder
  • autocomplete
  • datepicker
  • timepicker