mojavi
[ class tree: mojavi ] [ index: mojavi ] [ all elements ]

Class: StringValidator

Source Location: /validator/StringValidator.class.php

Class Overview

ParameterHolder
   |
   --Validator
      |
      --StringValidator

StringValidator allows you to apply string-related constraints to a parameter.


Author(s):

  • Sean Kerr (skerr@mojavi.org)

Version:

  • $Id: StringValidator.class.php 492 2004-11-26 03:56:47Z seank $

Copyright:

Methods


Inherited Variables

Inherited Methods

Class: Validator

Validator::execute()
Execute this validator.
Validator::getContext()
Retrieve the current application context.
Validator::initialize()
Initialize this validator.

Class: ParameterHolder

ParameterHolder::clearParameters()
Clear all parameters associated with this request.
ParameterHolder::getParameter()
Retrieve a parameter.
ParameterHolder::getParameterNames()
Retrieve an array of parameter names.
ParameterHolder::getParameters()
Retrieve an array of parameters.
ParameterHolder::hasParameter()
Indicates whether or not a parameter exists.
ParameterHolder::removeParameter()
Remove a parameter.
ParameterHolder::setParameter()
Set a parameter.
ParameterHolder::setParameterByRef()
Set a parameter by reference.
ParameterHolder::setParameters()
Set an array of parameters.
ParameterHolder::setParametersByRef()
Set an array of parameters by reference.

Class Details

[line 44]
StringValidator allows you to apply string-related constraints to a parameter.

Optional parameters:

  • insensitive - [false] - Whether or not the value check against the array of values is case-insensitive. Note: When using this option, values in the values array must be entered in lower-case.
  • max - [none] - Maximum string length.
  • max_error - [Input is too long] - An error message to use when input is too long.
  • min - [none] - Minimum string length.
  • min_error - [Input is too short] - An error message to use when input is too short.
  • values - [none] - An array of values the input is allowed to match.
  • values_error - [Invalid selection] - An error message to use when input does not match a value listed in the values array.




Tags:

version:  $Id: StringValidator.class.php 492 2004-11-26 03:56:47Z seank $
since:  1.0.0
copyright:  (c) Sean Kerr, http://www.mojavi.org
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]


Class Methods


method execute [line 63]

bool execute( mixed &$value, error &$error)

Execute this validator.



Tags:

return:  true, if this validator executes successfully, otherwise false.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Overrides Validator::execute() (Execute this validator.)

Parameters:

mixed   &$value   A parameter value.
error   &$error   An error message reference.

[ Top ]

method initialize [line 128]

bool initialize( Context $context, [array $parameters = null])

Initialize this validator.



Tags:

return:  true, if initialization completes successfully, otherwise false.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Overrides Validator::initialize() (Initialize this validator.)

Parameters:

Context   $context   The current application context.
array   $parameters   An associative array of initialization parameters.

[ Top ]


Documentation generated on Tue, 21 Feb 2006 01:45:29 +0900 by phpDocumentor 1.3.0RC5