public static function getElement($name = '', $widgetId = '')
    {
        $eltClass = null;
        
        $definition = WidgetRegistry::getWidgetDefinitionById($widgetId);
        if (is_null($definition) || !isset($definition['renderers'][self::$renderMode])) {
            
            // could be a "pseudo" widget that has not been registered
            $candidate = "tao_helpers_form_elements_xhtml_{$widgetId}";
            if (class_exists($candidate)) {
                $eltClass = $candidate;
            }
        } else {
            $eltClass = $definition['renderers'][self::$renderMode];
        }
        
        if (!is_null($eltClass)) {
            $returnValue = new $eltClass($name);
            if(!$returnValue instanceof tao_helpers_form_FormElement){
                throw new common_Exception("$eltClass must be a tao_helpers_form_FormElement");
            }
        } else {
            $returnValue = null;
            common_Logger::w("Widget type with id ".$widgetId." not yet supported", array('FORM'));
        }
                
        return $returnValue;
    }
public static function getElement($name = '', $widgetId = '')
    {
        $eltClass = null;
        
        $definition = WidgetRegistry::getWidgetDefinitionById($widgetId);
        if (is_null($definition) || !isset($definition['renderers'][self::$renderMode])) {
            
            // could be a "pseudo" widget that has not been registered
            $candidate = "tao_helpers_form_elements_xhtml_{$widgetId}";
            if (class_exists($candidate)) {
                $eltClass = $candidate;
            }
        } else {
            $eltClass = $definition['renderers'][self::$renderMode];
        }
        
        if (!is_null($eltClass)) {
            $returnValue = new $eltClass($name);
            if(!$returnValue instanceof tao_helpers_form_FormElement){
                throw new common_Exception("$eltClass must be a tao_helpers_form_FormElement");
            }
        } else {
            $returnValue = null;
            common_Logger::w("Widget type with id ".$widgetId." not yet supported", array('FORM'));
        }
                
        return $returnValue;
    }
public static function getElement ( $ name = '' , $ widgetId = '' ) { $ eltClass = null ; $ definition = WidgetRegistry :: getWidgetDefinitionById ( $ widgetId ) ; if ( is_null ( $ definition ) || ! isset ( $ definition [ 'renderers' ] [ self :: $ renderMode ] ) ) { // could be a "pseudo" widget that has not been registered $ candidate = "tao_helpers_form_elements_xhtml_{$widgetId}" ; if ( class_exists ( $ candidate ) ) { $ eltClass = $ candidate ; } } else { $ eltClass = $ definition [ 'renderers' ] [ self :: $ renderMode ] ; } if ( ! is_null ( $ eltClass ) ) { $ returnValue = new $ eltClass ( $ name ) ; if ( ! $ returnValue instanceof tao_helpers_form_FormElement ) { throw new common_Exception ( "$eltClass must be a tao_helpers_form_FormElement" ) ; } } else { $ returnValue = null ; common_Logger :: w ( "Widget type with id " . $ widgetId . " not yet supported" , array ( 'FORM' ) ) ; } return $ returnValue ; }
Create dynamically a Form Element instance of the defined type

@access public
@author Bertrand Chevrier, <bertrand.chevrier@tudor.lu>
@param  string $name
@param  string $widgetId
@return tao_helpers_form_FormElement
@throws common_Exception
@throws Exception
Create dynamically a Form Element instance of the defined type