src/Contao/View/Contao2BackendView/ContaoWidgetManager.php
public function renderWidget($property, $ignoreErrors = false, PropertyValueBag $inputValues = null)
    {
        /** @var Widget $widget */
        $widget = $this->getWidget($property, $inputValues);
        if (!$widget) {
            throw new DcGeneralRuntimeException('No widget for property ' . $property);
        }

        $this->cleanErrors($widget, $ignoreErrors);
        $this->widgetAddError($property, $widget, $inputValues, $ignoreErrors);

        $propInfo = $this->getEnvironment()->getDataDefinition()->getPropertiesDefinition()->getProperty($property);
        $content  = (new ContaoBackendViewTemplate('dcbe_general_field'))
            ->set('strName', $property)
            ->set('strClass', $widget->tl_class)
            ->set('widget', $widget->parse())
            ->set('hasErrors', $widget->hasErrors())
            ->set('strDatepicker', $this->getDatePicker($propInfo->getExtra(), $widget))
            // We used the var blnUpdate before.
            ->set('blnUpdate', false)
            ->set('strHelp', $this->generateHelpText($property))
            ->set('strId', $widget->id)
            ->parse();

        return $this->loadRichTextEditor($content, $widget);
    }
public function renderWidget($property, $ignoreErrors = false, PropertyValueBag $inputValues = null)
    {
        /** @var Widget $widget */
        $widget = $this->getWidget($property, $inputValues);
        if (!$widget) {
            throw new DcGeneralRuntimeException('No widget for property ' . $property);
        }

        $this->cleanErrors($widget, $ignoreErrors);
        $this->widgetAddError($property, $widget, $inputValues, $ignoreErrors);

        $propInfo = $this->getEnvironment()->getDataDefinition()->getPropertiesDefinition()->getProperty($property);
        $content  = (new ContaoBackendViewTemplate('dcbe_general_field'))
            ->set('strName', $property)
            ->set('strClass', $widget->tl_class)
            ->set('widget', $widget->parse())
            ->set('hasErrors', $widget->hasErrors())
            ->set('strDatepicker', $this->getDatePicker($propInfo->getExtra(), $widget))
            // We used the var blnUpdate before.
            ->set('blnUpdate', false)
            ->set('strHelp', $this->generateHelpText($property))
            ->set('strId', $widget->id)
            ->parse();

        return $this->loadRichTextEditor($content, $widget);
    }
public function renderWidget ( $ property , $ ignoreErrors = false , PropertyValueBag $ inputValues = null ) { /** @var Widget $widget */ $ widget = $ this -> getWidget ( $ property , $ inputValues ) ; if ( ! $ widget ) { throw new DcGeneralRuntimeException ( 'No widget for property ' . $ property ) ; } $ this -> cleanErrors ( $ widget , $ ignoreErrors ) ; $ this -> widgetAddError ( $ property , $ widget , $ inputValues , $ ignoreErrors ) ; $ propInfo = $ this -> getEnvironment ( ) -> getDataDefinition ( ) -> getPropertiesDefinition ( ) -> getProperty ( $ property ) ; $ content = ( new ContaoBackendViewTemplate ( 'dcbe_general_field' ) ) -> set ( 'strName' , $ property ) -> set ( 'strClass' , $ widget -> tl_class ) -> set ( 'widget' , $ widget -> parse ( ) ) -> set ( 'hasErrors' , $ widget -> hasErrors ( ) ) -> set ( 'strDatepicker' , $ this -> getDatePicker ( $ propInfo -> getExtra ( ) , $ widget ) ) // We used the var blnUpdate before. -> set ( 'blnUpdate' , false ) -> set ( 'strHelp' , $ this -> generateHelpText ( $ property ) ) -> set ( 'strId' , $ widget -> id ) -> parse ( ) ; return $ this -> loadRichTextEditor ( $ content , $ widget ) ; }
Render the widget for the named property.

@param string           $property     The name of the property for which the widget shall be rendered.
@param bool             $ignoreErrors Flag if the error property of the widget shall get cleared prior rendering.
@param PropertyValueBag $inputValues  The input values to use (optional).

@return string

@throws DcGeneralRuntimeException For unknown properties.
Render the widget for the named property .