2017 © Pedro Peláez
 

symfony-bundle bs4-form-theme-adjuster-bundle

image

ttskch/bs4-form-theme-adjuster-bundle

  • Saturday, January 20, 2018
  • by ttskch
  • Repository
  • 1 Watchers
  • 0 Stars
  • 39 Installations
  • CSS
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 3 % Grown

The README.md

TtskchBs4FormThemeAdjusterBundle

Latest Stable Version Total Downloads, (*1)

Before After
Vertical layout image image
Horizontal layout image image

Features

  • Automatic insertion of required sign (*)
  • Appropriate margin for checkbox has checkbox-inline class and radio button has radio-inline class
  • Muted placeholder of <select>
  • More beautiful submit button

Requirement

  • Symfony ^3.4|^4.0

Instalation

1. composer require

$ composer require ttskch/bs4-form-theme-adjuster-bundle:@dev

2. Register with symfony

// config/bundles.php
return [
    // ...
    Ttskch\Bs4FormThemeAdjusterBundle\TtskchBs4FormThemeAdjusterBundle:class => ['all' => true],
];

3. Configure

# config/packages/twig.yaml
twig:
    form_themes:
        - 'ttskch_bootstrap_4_layout.html.twig'
        - 'ttskch_bootstrap_4_horizontal_layout.html.twig'  # to be the default theme

4. Install assets

$ bin/console assets:install --symlink public

5. Add loading assets into your layout

<script src="{{ asset('bundles/ttskchbs4formthemeadjuster/js/form.js') }}"></script>
<link href="{{ asset('bundles/ttskchbs4formthemeadjuster/css/form.css') }}" rel="stylesheet">

If you use webpack (e.g. via symfony/webpack-encore) you can add assets to your app like below., (*2)

Encore
    // ...
    .createSharedEntry('vendors', [
        'jquery',
        'bootstrap',
        'popper.js',
+       './public/bundles/ttskchbs4formthemeadjuster/js/form.js',
+       './public/bundles/ttskchbs4formthemeadjuster/scss/form.scss',
    ])
    // ...
;

Getting involved

  1. Modify following resources
    • Resources/views/Form/*.twig
    • Resources/public/js/form.js
    • Resources/public/scss/form.scss
  2. Build scss with npm run build

The Versions

20/01 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

symfony bootstrap4 form theme

03/01 2018

dev-wip

dev-wip

  Sources   Download

MIT

The Requires

 

symfony bootstrap4 form theme