src/Form/Renderer/Bootstrap.php
public function date(Form\Element\Date $element)
    {
        // Error
        if($hasError = !$element->getValidator()->isValid()){
            $element->removeAttribute('data-trigger');//Si il y avait un popoover au départ on le surcharge par un tooltip
            if(empty($element->getAttribute('data-placement'))){$element->addAttribute('data-placement','bottom');}
            $message = '';
            foreach($element->getValidator()->getErrors() as $error){
                $message .= $error . ' ';
            }
            $element->addAttribute('data-original-title',$message);
            $element->addAttribute('data-toggle', 'tooltip');
        }

        $element->addClass('date-picker');

        // rendu principal
        $element->addClass(Style::FORM_ELEMENT_CONTROL);
        $label = '';

        $element->addAttribute('value', $element->getDisplayValue());
        if ($element->getForm()->hasLabel()) {
            $label = '<label for="' . $element->getName() . '">' . $element->getLabel() . ($element->hasRule('required') ? ' *' : '') . '</label>';
        }
        $html = $label . html('input', $element->getAttributes());

        $class =  Style::FORM_GROUP_CLASS;
        if ($hasError) {
            $class .= ' ' .Style::FORM_GROUP_ERROR;
        }

        $html = html('div', compact('class'), $html);

        return $html;
    }
public function date(Form\Element\Date $element)
    {
        // Error
        if($hasError = !$element->getValidator()->isValid()){
            $element->removeAttribute('data-trigger');//Si il y avait un popoover au départ on le surcharge par un tooltip
            if(empty($element->getAttribute('data-placement'))){$element->addAttribute('data-placement','bottom');}
            $message = '';
            foreach($element->getValidator()->getErrors() as $error){
                $message .= $error . ' ';
            }
            $element->addAttribute('data-original-title',$message);
            $element->addAttribute('data-toggle', 'tooltip');
        }

        $element->addClass('date-picker');

        // rendu principal
        $element->addClass(Style::FORM_ELEMENT_CONTROL);
        $label = '';

        $element->addAttribute('value', $element->getDisplayValue());
        if ($element->getForm()->hasLabel()) {
            $label = '<label for="' . $element->getName() . '">' . $element->getLabel() . ($element->hasRule('required') ? ' *' : '') . '</label>';
        }
        $html = $label . html('input', $element->getAttributes());

        $class =  Style::FORM_GROUP_CLASS;
        if ($hasError) {
            $class .= ' ' .Style::FORM_GROUP_ERROR;
        }

        $html = html('div', compact('class'), $html);

        return $html;
    }
public function date ( Form \ Element \ Date $ element ) { // Error if ( $ hasError = ! $ element -> getValidator ( ) -> isValid ( ) ) { $ element -> removeAttribute ( 'data-trigger' ) ; //Si il y avait un popoover au départ on le surcharge par un tooltip if ( empty ( $ element -> getAttribute ( 'data-placement' ) ) ) { $ element -> addAttribute ( 'data-placement' , 'bottom' ) ; } $ message = '' ; foreach ( $ element -> getValidator ( ) -> getErrors ( ) as $ error ) { $ message .= $ error . ' ' ; } $ element -> addAttribute ( 'data-original-title' , $ message ) ; $ element -> addAttribute ( 'data-toggle' , 'tooltip' ) ; } $ element -> addClass ( 'date-picker' ) ; // rendu principal $ element -> addClass ( Style :: FORM_ELEMENT_CONTROL ) ; $ label = '' ; $ element -> addAttribute ( 'value' , $ element -> getDisplayValue ( ) ) ; if ( $ element -> getForm ( ) -> hasLabel ( ) ) { $ label = '<label for="' . $ element -> getName ( ) . '">' . $ element -> getLabel ( ) . ( $ element -> hasRule ( 'required' ) ? ' *' : '' ) . '</label>' ; } $ html = $ label . html ( 'input' , $ element -> getAttributes ( ) ) ; $ class = Style :: FORM_GROUP_CLASS ; if ( $ hasError ) { $ class .= ' ' . Style :: FORM_GROUP_ERROR ; } $ html = html ( 'div' , compact ( 'class' ) , $ html ) ; return $ html ; }
Render a date element

@param \FrenchFrogs\Form\Element\Date $element
@return string
Render a date element