# Datus

Extra powerful form schema.

# Usage

example:
	control:
		label: Example label
		type: text

		# HTML attributes
		attributes:
			placeholder: Example placeholder

		# Custom input-based options
		options: []

	# Data
	defaultValue: xyz

	# Data validations
	validations: []
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

# Controls

Here is a complete list of control types:

  • button
  • checkbox
  • checkboxlist
  • date
  • datetime
  • email
  • float
  • hidden
  • integer
  • multiselect
  • multiupload
  • numeric
  • password
  • radiolist
  • select
  • strongpassword
  • submit
  • textarea
  • text
  • time
  • upload
  • url

# Basic

Attributes

  • placeholder (string)
  • readonly (boolean)
  • disabled (boolean)

# Button

example:
	control:
		label: Example label
		type: button
1
2
3
4

# Checkbox

example:
	control:
		label: Example label
		type: checkbox
1
2
3
4

# CheckboxList

example:
	control:
		label: Example label
		type: checkboxlist
		options:
			items: [user, admin]
			useKeys: true | false
1
2
3
4
5
6
7
  • useKeys: false => values are user, admin
  • useKeys: true => values are 0, 1

# Date

example:
	control:
		label: Example label
		type: date
	options:
		shortcuts:
			- {title: 'Tomorrow', date: '+1 day'}
1
2
3
4
5
6
7

# DateTime

example:
	control:
		label: Example label
		type: datetime
	options:
		shortcuts:
			- {title: 'Tomorrow', date: '+1 day'}
1
2
3
4
5
6
7

# Email

example:
	control:
		label: Example label
		type: email
1
2
3
4

# Float

example:
	control:
		label: Example label
		type: float
1
2
3
4

# Hidden

example:
	control:
		label: Example label
		type: hidden
1
2
3
4

# Image

example:
	control:
		label: https://procesy.adminus.cz/components/web/img/logo.svg
		type: image
1
2
3
4

# Integer

example:
	control:
		label: Example label
		type: integer
1
2
3
4

# MultiSelect

example:
	control:
		label: Example label
		type: multiselect
		options:
			items: [user, admin]
			useKeys: true | false
1
2
3
4
5
6
7
  • useKeys: false => values are user, admin
  • useKeys: true => values are 0, 1

# MultiUpload

example:
	control:
		label: Example label
		type: multiselect
1
2
3
4

# Numeric

example:
	control:
		label: Example label
		type: numeric
1
2
3
4

# Password

example:
	control:
		label: Example label
		type: password
1
2
3
4

# RadioList

example:
	control:
		label: Example label
		type: radiolist
		options:
			items: [user, admin]
			useKeys: true | false
1
2
3
4
5
6
7
  • useKeys: false => values are user, admin
  • useKeys: true => values are 0, 1

# Select

example:
	control:
		label: Example label
		type: select
		options:
			items: [user, admin]
			useKeys: true | false
1
2
3
4
5
6
7
  • useKeys: false => values are user, admin
  • useKeys: true => values are 0, 1

# StrongPassword

example:
	control:
		label: Example label
		type: strongpassword
1
2
3
4

# Submit

example:
	control:
		label: Example label
		type: submit
1
2
3
4

# Textarea

example:
	control:
		label: Example label
		type: textarea
1
2
3
4

# Text

example:
	control:
		label: Example label
		type: text
1
2
3
4

# Time

example:
	control:
		label: Example label
		type: time
1
2
3
4

# Upload

example:
	control:
		label: Example label
		type: upload
1
2
3
4

Not working, use file panels instead.

# Upload

example:
	control:
		label: Example label
		type: url
1
2
3
4

# Validations

The symfony/validator is used for performing validation. Take a look at the offical documentation(opens new window) .

Here is a complete list of supported validators:

symfony/validator

  • blank
  • currency
  • date
  • datetime
  • email
  • equalTo
  • file
  • greaterThan
  • greaterThanOrEqual
  • iban
  • identicalTo
  • image
  • ip
  • isbn
  • language
  • length
  • lessThan
  • lessThanOrEqual
  • locale
  • notBlank
  • notNull
  • range
  • regex
  • time
  • url
  • uuid

datus

  • dateTimeGreaterThan
  • dateTimeRelative

# Basic

Required

By default are inputs optional. You can change it by validation required.

example:
	control: {...}
	validations:
		required: true
1
2
3
4

# NotBlank

example:
	control: {...}
	validations:
		notBlank: [message: "Subject must be filled"]
1
2
3
4

# DateTimeGreaterThan

example:
	control: {...}
	validations:
		dateTimeGreaterThan: [message: "Term must be in the future", compareTo: "NOW"]
		dateTimeGreaterThan: [message: "Term must be in the next month", compareTo: "first day of next month]
1
2
3
4
5

# DateTimeRelative

example:
	control: {...}
	validations:
		dateTimeRelative: []
		dateTimeRelative: [message: "Invoice expiration is not valid relative format"]
1
2
3
4
5