Cake\View\Helper\FormHelper::day PHP Method

day() public method

### Options: - 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 day ( string | null $fieldName = null, array $options = [] ) : string
$fieldName string | null Prefix name for the SELECT element
$options array Options & HTML attributes for the select element
return string A generated day select box.
    public function day($fieldName = null, array $options = [])
    {
        $options = $this->_singleDatetime($options, 'day');
        if (isset($options['val']) && $options['val'] > 0 && $options['val'] <= 31) {
            $options['val'] = ['year' => date('Y'), 'month' => date('m'), 'day' => (int) $options['val']];
        }
        return $this->dateTime($fieldName, $options);
    }

Usage Example

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