Duration

Use the duration type to show periods of time.

Included in the PerformBaseBundle.

Options

format

How to display the duration. Use one of the DurationType::FORMAT_* constants.

This option is optional.

Allowed types: integer

Defaults:

  • List context: 0
  • View context: 2
  • Create context: 0
  • Edit context: 0

label

The label to use for form labels and table headings. If no label is provided, a sensible label will be created automatically.

This option is optional.

Allowed types: string

Defaults:

  • List context: No default
  • View context: No default
  • Create context: No default
  • Edit context: No default

Example

<?php
$config->add('length', [
    'type' => 'duration',
    'options' => [
        'format' => DurationType::FORMAT_HUMAN,
    ],
]);