heimrichhannot/contao-widgetcollection

A collection of contao widgets.

1.4.1 2018-06-01 08:52 UTC

This package is not auto-updated.

Last update: 2024-11-19 20:26:47 UTC


README

Latest Stable Version Total Downloads

This module is currently only used in a single Contao 3 project and not generally tested. Feedback is welcome.

This module is a collection of contao widgets that add some advanced (backend) validation to the input fields. They are designed to use with Formhybrid module.

Install

With composer:

composer require heimrichhannot/contao-widgetcollection

Widgets

BIC (Swift) bicWidget

Validates a BIC/SWIFT-Adress.

Uses IsoCodes for validation.

Usage

'inputType' => 'bicWidget',

Birthday birthdayWidget

Validates a birthday.

Usage

'inputType' => 'birthdayWidget',
'eval'      => [
    'minAge' => 18, // Set a min age. Set 0 to disable
    'maxAge' => 0, // Set a max age. Set 0 to disable
    'format' => 'd.m.Y' // The format of the input date
   
]

IBAN ibanWidget

Validates an IBAN number.

Uses IsoCodes for validation.

Usage

'inputType' => 'ibanWidget',
'eval' => [
    'fields' => 22, // Number of input fields. Default is 22. 
    'prefill' => '' // A optional prefilled value, for example to set the typical country (example: "DE").
]

Phone phoneWidget

Validates a phone number.

Uses IsoCodes for validation.

Usage

'inputType' => 'phoneWidget',
'eval' => [
    'countries' => ['DE', 'AT'] // Array with country codes
]

Postal code postalWidget

Validate a postal code.

Uses IsoCodes for validation.

Usage

'inputType' => 'postalWidget',
'eval'      => [
    'countries' => ['DE', 'AT'] // Array with country codes
]