public function load($classname, $name = null) {

		if(false === is_string($classname)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($classname)), E_USER_ERROR);
		}

		if(null !== $name && false === is_string($name)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($name)), E_USER_ERROR);
		}

		$directories 	= explode('.', $classname); //Convert dots to directory seperators
		$amount 		= count($directories) - 1;
		$namespace 		= Router :: getRoute() -> getModule() . '\\' . str_replace(DIRECTORY_SEPARATOR, '\\', Application :: get(['directory', 'validator']));

		foreach($directories as $index => $directory) {

			if($amount === $index) {
				
				$namespace .= Application :: get(['prefix', 'validator']) . ucfirst($directory);
				break;
			}

			$namespace 	.= $directory . '\\';
		}

		if(false === class_exists($namespace)) {
			return trigger_error(sprintf('Class "%s" does not exists or is not a valid validator rule', $namespace), E_USER_ERROR);
		}

		$name = (null !== $name ? $name : $directory);
		$this -> custom[$name] = $namespace;

		$instance = $this -> getMessageInstance();
		$instance :: loadCustom($directory, $namespace, $name);

		return $this;
	}
public function load($classname, $name = null) {

		if(false === is_string($classname)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($classname)), E_USER_ERROR);
		}

		if(null !== $name && false === is_string($name)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($name)), E_USER_ERROR);
		}

		$directories 	= explode('.', $classname); //Convert dots to directory seperators
		$amount 		= count($directories) - 1;
		$namespace 		= Router :: getRoute() -> getModule() . '\\' . str_replace(DIRECTORY_SEPARATOR, '\\', Application :: get(['directory', 'validator']));

		foreach($directories as $index => $directory) {

			if($amount === $index) {
				
				$namespace .= Application :: get(['prefix', 'validator']) . ucfirst($directory);
				break;
			}

			$namespace 	.= $directory . '\\';
		}

		if(false === class_exists($namespace)) {
			return trigger_error(sprintf('Class "%s" does not exists or is not a valid validator rule', $namespace), E_USER_ERROR);
		}

		$name = (null !== $name ? $name : $directory);
		$this -> custom[$name] = $namespace;

		$instance = $this -> getMessageInstance();
		$instance :: loadCustom($directory, $namespace, $name);

		return $this;
	}
public function load ( $ classname , $ name = null ) { if ( false === is_string ( $ classname ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ classname ) ) , E_USER_ERROR ) ; } if ( null !== $ name && false === is_string ( $ name ) ) { return trigger_error ( sprintf ( 'Argument 2 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ name ) ) , E_USER_ERROR ) ; } $ directories = explode ( '.' , $ classname ) ; //Convert dots to directory seperators
 $ amount = count ( $ directories ) - 1 ; $ namespace = Router :: getRoute ( ) -> getModule ( ) . '\\' . str_replace ( DIRECTORY_SEPARATOR , '\\' , Application :: get ( [ 'directory' , 'validator' ] ) ) ; foreach ( $ directories as $ index => $ directory ) { if ( $ amount === $ index ) { $ namespace .= Application :: get ( [ 'prefix' , 'validator' ] ) . ucfirst ( $ directory ) ; break ; } $ namespace .= $ directory . '\\' ; } if ( false === class_exists ( $ namespace ) ) { return trigger_error ( sprintf ( 'Class "%s" does not exists or is not a valid validator rule' , $ namespace ) , E_USER_ERROR ) ; } $ name = ( null !== $ name ? $ name : $ directory ) ; $ this -> custom [ $ name ] = $ namespace ; $ instance = $ this -> getMessageInstance ( ) ; $ instance :: loadCustom ( $ directory , $ namespace , $ name ) ; return $ this ; }
Loads a custom validator rule with optional validator name
@param string $classname
@param string $name
@return sFire\Validator
Loads a custom validator rule with optional validator name