" . "\n"; echo "\n"; self::$INITED = true; } if ($initObject) { if (isset($initObject[self::$ELEMENT_DIR_NAMES])) { self::$ELEMENT_FACTORY_DIRS = $initObject[self::$ELEMENT_DIR_NAMES]; } if (isset($initObject[self::$VALIDATOR_DIR_NAMES])) { self::$VALIDATOR_FACTORY_DIRS = $initObject[self::$VALIDATOR_DIR_NAMES]; } if (isset($initObject[self::$BEHAVIOR_DIR_NAMES])) { self::$BEHAVIOR_FACTORY_DIRS = $initObject[self::$BEHAVIOR_DIR_NAMES]; } } } public static function loadElement($elementClassName, $id, $parentNode = null, $wrapExisting = false, $dynamic = false) { Zend::loadClass($elementClassName, self::$ELEMENT_FACTORY_DIRS); $newObject = new $elementClassName($id, $parentNode); if (! ($newObject instanceof ZFormElement)) { throw new ZFormElementException("$elementClassName is not an " . 'instance of ZFormElement'); } $newObject->setWrapExisting($wrapExisting); return($dynamic ? new ZFormDynamicElement($newObject) : $newObject); } public static function wrapElement($elementClassName, $id, $parentNode = null, $dynamic = false) { return(self::loadElement($elementClassName, $id, $parentNode, true, $dynamic)); } public static function loadValidator($validatorClassName, ZFormElement $target) { Zend::loadClass($validatorClassName, self::$VALIDATOR_FACTORY_DIRS); $newObject = new $validatorClassName($target); if (! ($newObject instanceof ZFormElementValidator)) { throw new ZFormElementException("$validatorClassName is not an " . 'instance of ZFormElementValidator'); } return($newObject); } public static function loadBehavior($behaviorClassName, $targetElement) { Zend::loadClass($behaviorClassName, self::$BEHAVIOR_FACTORY_DIRS); $newObject = new $behaviorClassName($targetElement); if (! ($newObject instanceof ZFormElementBehavior)) { throw new ZFormElementException("$behaviorClassName is not an " . 'instance of ZFormElementBehavior'); } return($newObject); } } ?>