public function renderWidget($property, $ignoreErrors = false, PropertyValueBag $valueBag = null)
    {
        $widget = $this->getWidget($property, $valueBag);

        if (!$widget) {
            throw new DcGeneralRuntimeException('No widget for property ' . $property);
        }

        if ($ignoreErrors) {
            // Clean the errors array and fix up the CSS class.
            $reflection = new \ReflectionProperty(get_class($widget), 'arrErrors');
            $reflection->setAccessible(true);
            $reflection->setValue($widget, []);
            $reflection = new \ReflectionProperty(get_class($widget), 'strClass');
            $reflection->setAccessible(true);
            $reflection->setValue($widget, str_replace('error', '', $reflection->getValue($widget)));
        } else {
            if ($valueBag && $valueBag->hasPropertyValue($property)
                && $valueBag->isPropertyValueInvalid($property)
            ) {
                foreach ($valueBag->getPropertyValueErrors($property) as $error) {
                    $widget->addError($error);
                }
            }
        }

        return $widget->parse();
    }
public function renderWidget($property, $ignoreErrors = false, PropertyValueBag $valueBag = null)
    {
        $widget = $this->getWidget($property, $valueBag);

        if (!$widget) {
            throw new DcGeneralRuntimeException('No widget for property ' . $property);
        }

        if ($ignoreErrors) {
            // Clean the errors array and fix up the CSS class.
            $reflection = new \ReflectionProperty(get_class($widget), 'arrErrors');
            $reflection->setAccessible(true);
            $reflection->setValue($widget, []);
            $reflection = new \ReflectionProperty(get_class($widget), 'strClass');
            $reflection->setAccessible(true);
            $reflection->setValue($widget, str_replace('error', '', $reflection->getValue($widget)));
        } else {
            if ($valueBag && $valueBag->hasPropertyValue($property)
                && $valueBag->isPropertyValueInvalid($property)
            ) {
                foreach ($valueBag->getPropertyValueErrors($property) as $error) {
                    $widget->addError($error);
                }
            }
        }

        return $widget->parse();
    }
public function renderWidget ( $ property , $ ignoreErrors = false , PropertyValueBag $ valueBag = null ) { $ widget = $ this -> getWidget ( $ property , $ valueBag ) ; if ( ! $ widget ) { throw new DcGeneralRuntimeException ( 'No widget for property ' . $ property ) ; } if ( $ ignoreErrors ) { // Clean the errors array and fix up the CSS class. $ reflection = new \ ReflectionProperty ( get_class ( $ widget ) , 'arrErrors' ) ; $ reflection -> setAccessible ( true ) ; $ reflection -> setValue ( $ widget , [ ] ) ; $ reflection = new \ ReflectionProperty ( get_class ( $ widget ) , 'strClass' ) ; $ reflection -> setAccessible ( true ) ; $ reflection -> setValue ( $ widget , str_replace ( 'error' , '' , $ reflection -> getValue ( $ widget ) ) ) ; } else { if ( $ valueBag && $ valueBag -> hasPropertyValue ( $ property ) && $ valueBag -> isPropertyValueInvalid ( $ property ) ) { foreach ( $ valueBag -> getPropertyValueErrors ( $ property ) as $ error ) { $ widget -> addError ( $ error ) ; } } } return $ widget -> parse ( ) ; }
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 $valueBag     The input values to use (optional).

@return string

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