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

Class: Formagic_Rule_StringLength

Source Location: /Rule/StringLength.php

Class Overview

Formagic_Rule_Abstract
   |
   --Formagic_Rule_RangeComparsion_Abstract
      |
      --Formagic_Rule_StringLength

Checks if value is between min and max length


Author(s):

  • Marc Schrader
  • Florian Sonnenburg

Version:

  • $Id: StringLength.php 126 2011-05-18 18:41:58Z meweasle $

Copyright:

  • Copyright (c) 2007-2011 Florian Sonnenburg

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 57]
Checks if value is between min and max length

If only one numeric value is passed as argument, this value is interpreted as min length value.

Supported arguments are:

  1.  Formagic_Rule_StringLength::__construct(array(
  2.       'min' => (int)$min,
  3.       'max' => (int)$max,
  4.       'messages' => array(
  5.           'min' => (string)$errorMessage,
  6.           'min' => (string)$errorMessage,
  7.           'between' => (string)$errorMessage,
  8.       )
  9.  ));
  10.  Formagic_Rule_StringLength::__construct(array('min' => (int)$min'max' => (int)$max));




Tags:

author:  Marc Schrader
author:  Florian Sonnenburg
version:  $Id: StringLength.php 126 2011-05-18 18:41:58Z meweasle $
copyright:  Copyright (c) 2007-2011 Florian Sonnenburg


[ Top ]


Class Variables

$_messages = array(
        'min' => 'Please enter at least %s characters',
        'max' => 'Please enter no more than %s characters',
        'between' => 'Please enter between %s and %s characters'
    )

[line 63]

Default error messages



Tags:

access:  protected

Type:   array
Overrides:   Array


[ Top ]



Class Methods


method _getRange [line 75]

integer _getRange( string $value)

Returns range check value.



Tags:

return:  Range check value
access:  protected


Overrides Formagic_Rule_RangeComparsion_Abstract::_getRange() (Returns range check value.)

Parameters:

string   $value   Item value

[ Top ]


Documentation generated on Sun, 22 May 2011 22:40:22 +0200 by phpDocumentor 1.4.3