Login   Register  
PHP Classes
elePHPant
Icontem

File: samples/rule.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Tom Schaefer  >  QValidation  >  samples/rule.php  >  Download  
File: samples/rule.php
Role: Example script
Content type: text/plain
Description: sample rule
Class: QValidation
Validate several types of value
Author: By
Last change: add
Date: 2009-05-14 23:03
Size: 499 bytes
 

Contents

Class file image Download
<?php 
include_once("config.inc.php");
include_once(
PLUGINDIR.DS."Validation".DS."DataType".DS."index.php");
include_once(
PLUGINDIR.DS."Validation".DS."Rule".DS."index.php");

$rule = new Validation_Rule_ISBN("3827370191");
if(
$rule->firstLevel()->secondLevel()->isValid()) {
    echo 
"succeed";
} else {
    echo 
"failure";
}


if(
Validation_Rule_ISBN::getInstance("3827370192")->firstLevel()->secondLevel()->isValid()) {
    echo 
"succeed";
} else {
    echo 
"failure";
}


print_r($rule);