Ready to upload to benroberts.net/ecs
tidied up unneeded files, played with css added an empty projects page. removed the cv page and instead hyperlinked directly to .pdf
This commit is contained in:
40
code/validation/range_validator.php
Normal file
40
code/validation/range_validator.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class RangeValidator implements IValidator {
|
||||
|
||||
private $min;
|
||||
private $max;
|
||||
|
||||
public function __construct($min, $max) {
|
||||
|
||||
}
|
||||
|
||||
public static function initialise() {
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
public static function shutdown() {
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
public function associate() {
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
public function disassociate() {
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
public function validate($input) {
|
||||
if( $input < $min || $input > $max )
|
||||
throw new ValidationException("Input is no in the range {$this->min}-{$this->max}");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user