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

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

### Options: - monthNames - If false, 2 digit numbers will be used instead of text. If an array, the given array will be used. - 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 month ( string $fieldName, array $options = [] ) : string
$fieldName string Prefix name for the SELECT element
$options array Attributes for the select element
Результат string A generated month select dropdown.
    public function month($fieldName, array $options = [])
    {
        $options = $this->_singleDatetime($options, 'month');
        if (isset($options['val']) && $options['val'] > 0 && $options['val'] <= 12) {
            $options['val'] = ['year' => date('Y'), 'month' => (int) $options['val'], 'day' => date('d')];
        }
        return $this->dateTime($fieldName, $options);
    }

Usage Example

 public function month($fieldName, array $options = [])
 {
     $options = $this->_injectStyles($options, 'form-control');
     return parent::month($fieldName, $options);
 }