rtForm::generate_date PHP Method

generate_date() protected method

Generate rtmedia html date field in admin options.
protected generate_date ( $attributes ) : string
$attributes
return string
        protected function generate_date($attributes)
        {
            $element = 'rtDate';
            if (is_array($attributes)) {
                $html = '<input type="date" ';
                $html .= $this->processAttributes($element, $attributes);
                $html .= ' />';
                if (isset($attributes['label'])) {
                    if (isset($attributes['labelClass'])) {
                        $html = $this->enclose_label($element, $html, $attributes['label'], $attributes['labelClass']);
                    } else {
                        $html = $this->enclose_label($element, $html, $attributes['label']);
                    }
                }
                if (isset($attributes['show_desc']) && $attributes['desc']) {
                    $html .= $this->generate_element_desc($attributes);
                }
                return $html;
            } else {
                throw new rtFormInvalidArgumentsException('attributes');
            }
        }