Bootstrap\View\Helper\BootstrapFormHelper::dateTime PHP Метод

dateTime() публичный Метод

### Date Options: - empty - If true, the empty select option is shown. If a string, that string is displayed as the empty element. - value | default The default value to be used by the input. A value in $this->data matching the field name will override this value. If no default is provided time() will be used. - monthNames If false, 2 digit numbers will be used instead of text. If an array, the given array will be used. - minYear The lowest year to use in the year select - maxYear The maximum year to use in the year select - orderYear - Order of year values in select options. Possible values 'asc', 'desc'. Default 'desc'. ### Time options: - empty - If true, the empty select option is shown. If a string, - value | default The default value to be used by the input. A value in $this->data matching the field name will override this value. If no default is provided time() will be used. - timeFormat The time format to use, either 12 or 24. - interval The interval for the minutes select. Defaults to 1 - round - Set to up or down if you want to force rounding in either direction. Defaults to null. - second Set to true to enable seconds drop down. To control the order of inputs, and any elements/content between the inputs you can override the dateWidget template. By default the dateWidget template is: {{month}}{{day}}{{year}}{{hour}}{{minute}}{{second}}{{meridian}}`
public dateTime ( string $fieldName, array $options = [] ) : string
$fieldName string Prefix name for the SELECT element
$options array Array of Options
Результат string Generated set of select boxes for the date and time formats chosen.
    public function dateTime($fieldName, array $options = [])
    {
        $fields = ['year' => true, 'month' => true, 'day' => true, 'hour' => true, 'minute' => true, 'second' => false, 'timeFormat' => false];
        return $this->_wrapTemplates(['dateWidget' => $this->_getDatetimeTemplate($fields, $options)], 'parent::dateTime', [$fieldName, $options]);
    }