All pastes #965083 Raw Edit

Unnamed

public text v1 · immutable
#965083 ·published 2008-03-31 19:32 UTC
rendered paste body
<?php

class Validator extends ValidactionConfig {
		public static $validator=null;
		
		public static function valid() {
			if(self::$validator==null){
				self::$validator=new InputValidator;
			}
			return self::$validator;
		}
	
		public function __construct() {
		}
		
		private function isPropertySet($property) {
			if(isset($_POST[$property]))
			return true;
			else return false;
		}
		
		private function getIndex() {
			return array_keys($_POST);
		}
		
		public function execution() {
			$validator=self::valid();
			foreach($this->getIndex() AS $strIndex) {
					$this->getInput($strIndex);
					$validator->setInputName($strIndex);
					$validator->setClassValidator($this->getInputClass());
					$validator->setValidatorValues($this->getValues());
					try {
						$validator->execution();
					}
					catch( ValidationException $e ) {
						print $e;
					}
			}
			return true;
		}
		
	
	}
?>