Overview

Packages

  • Util

Classes

  • Horde_Array
  • Horde_Array_Sort_Helper
  • Horde_Domhtml
  • Horde_String
  • Horde_Util
  • Horde_Variables
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Variables

Horde_Variables:: class. Provides OO-way to access form variables.

Copyright 2009-2012 Horde LLC (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Horde_Variables implements Countable, Iterator, ArrayAccess
Package: Util
Category: Horde
License: LGPL 2.1
Author: Robert E. Coyle robertecoyle@hotmail.com
Author: Chuck Hagenbuch chuck@horde.org
Located at Horde/Variables.php
Methods summary
public static Horde_Variables
# getDefaultVariables( string $sanitize = false )

Returns a Horde_Variables object populated with the form input.

Returns a Horde_Variables object populated with the form input.

Parameters

$sanitize
Sanitize the input variables?

Returns

Horde_Variables
Variables object.
public
# __construct( array $vars = array(), string $sanitize = false )

Constructor.

Constructor.

Parameters

$vars
<p>The list of form variables (if null, defaults to PHP's $_REQUEST value).</p>
$sanitize
Sanitize the input variables?
public
# sanitize( )

Sanitize the form input.

Sanitize the form input.

public
# exists( mixed $varname )

Alias of isset().

Alias of isset().

See

Horde_Variables::__isset()
public boolean
# __isset( string $varname )

isset() implementation.

isset() implementation.

Parameters

$varname
The form variable name.

Returns

boolean
Does $varname form variable exist?
public
# offsetExists( mixed $field )

Implements isset() for ArrayAccess interface.

Implements isset() for ArrayAccess interface.

See

Horde_Variables::__isset()

Implementation of

ArrayAccess::offsetExists()
public mixed
# get( string $varname, string $default = null )

Returns the value of a given form variable.

Returns the value of a given form variable.

Parameters

$varname
The form variable name.
$default
The default form variable value.

Returns

mixed
The form variable, or $default if it doesn't exist.
public mixed
# __get( string $varname )

Returns the value of a given form variable.

Returns the value of a given form variable.

Parameters

$varname
The form variable name.

Returns

mixed
The form variable, or null if it doesn't exist.
public
# offsetGet( mixed $field )

Implements getter for ArrayAccess interface.

Implements getter for ArrayAccess interface.

See

Horde_Variables::__get()

Implementation of

ArrayAccess::offsetGet()
public mixed
# getExists( string $varname, boolean & $exists )

Given a variable name, returns the value and sets a variable indicating whether the value exists in the form data.

Given a variable name, returns the value and sets a variable indicating whether the value exists in the form data.

Parameters

$varname
The form variable name.
$exists
<p>$exists Reference to variable that will indicate whether $varname existed in form data.</p>

Returns

mixed
The form variable, or null if it doesn't exist.
public
# set( mixed $varname, mixed $value )

Sets the value of a given form variable.

Sets the value of a given form variable.

See

Horde_Variables::__set()
public
# __set( string $varname, mixed $value )

Sets the value of a given form variable.

Sets the value of a given form variable.

Parameters

$varname
The form variable name.
$value
The value to set.
public
# offsetSet( mixed $field, mixed $value )

Implements setter for ArrayAccess interface.

Implements setter for ArrayAccess interface.

See

Horde_Variables::__set()

Implementation of

ArrayAccess::offsetSet()
public
# remove( mixed $varname )

Deletes a given form variable.

Deletes a given form variable.

See

Horde_Variables::__unset()
public
# __unset( string $varname )

Deletes a given form variable.

Deletes a given form variable.

Parameters

$varname
The form variable name.
public
# offsetUnset( mixed $field )

Implements unset() for ArrayAccess interface.

Implements unset() for ArrayAccess interface.

See

Horde_Variables::__unset()

Implementation of

ArrayAccess::offsetUnset()
public
# merge( array $vars )

Merges a list of variables into the current form variable list.

Merges a list of variables into the current form variable list.

Parameters

$vars
Form variables.
public boolean
# add( string $varname, mixed $value )

Set $varname to $value ONLY if it's not already present.

Set $varname to $value ONLY if it's not already present.

Parameters

$varname
The form variable name.
$value
The value to set.

Returns

boolean
True if the value was altered.
public mixed
# filter( string $varname )

Filters a form value so that it can be used in HTML output.

Filters a form value so that it can be used in HTML output.

Parameters

$varname
The form variable name.

Returns

mixed
The filtered variable, or null if it doesn't exist.

Since

Horde_Util 1.2.0
public
# count( )

Implementation of

Countable::count()
public
# current( )

Implementation of

Iterator::current()
public
# key( )

Implementation of

Iterator::key()
public
# next( )

Implementation of

Iterator::next()
public
# rewind( )

Implementation of

Iterator::rewind()
public
# valid( )

Implementation of

Iterator::valid()
API documentation generated by ApiGen