PHP Classes

File: Validation/Rule/index.php

Recommend this page to a friend!
  Classes of Tom Schaefer   QValidation   Validation/Rule/index.php   Download  
File: Validation/Rule/index.php
Role: Auxiliary script
Content type: text/plain
Description: autoloader
Class: QValidation
Validate several types of value
Author: By
Last change:
Date: 15 years ago
Size: 494 bytes
 

Contents

Class file image Download
<?php

include_once(dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR."Validation.php");

function
validateRuleAutoload($class) {
    if (
substr($class, 0, strlen("Validation_Rule_")) === 'Validation_Rule_') {
        include
dirname(__FILE__).DIRECTORY_SEPARATOR.strtr(strtolower(substr($class, strlen("Validation_Rule_"))), '_', DIRECTORY_SEPARATOR).'.php';
    }
}
spl_autoload_register('validateRuleAutoload');
set_include_path(get_include_path().PATH_SEPARATOR.realpath(dirname(__FILE__)));