Cake\View\Helper\FormHelper::meridian PHP Метод

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

### Attributes: - empty - If true, the empty select option is shown. If a string, that string is displayed as the empty element. - value The selected value of the input.
public meridian ( string $fieldName, array $options = [] ) : string
$fieldName string Prefix name for the SELECT element
$options array Array of options
Результат string Completed meridian select input
    public function meridian($fieldName, array $options = [])
    {
        $options = $this->_singleDatetime($options, 'meridian');
        if (isset($options['val'])) {
            $hour = date('H');
            $options['val'] = ['hour' => $hour, 'minute' => (int) $options['val'], 'meridian' => $hour > 11 ? 'pm' : 'am'];
        }
        return $this->dateTime($fieldName, $options);
    }