API Documentation

Filter/Inflector.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Filter
version
$Id: Inflector.php 21372 2010-03-07 19:58:08Z thomas $
Classes
Zend_Filter_Inflector

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Filter_Inflector

Implements
Zend_Filter_Interface
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Filter
Properties
$_pluginLoader
$_target
$_throwTargetExceptionsOn
$_targetReplacementIdentifier
$_rules
Methods
__construct
getPluginLoader
setPluginLoader
setConfig
setOptions
addFilterPrefixPath
setThrowTargetExceptionsOn
isThrowTargetExceptionsOn
setTargetReplacementIdentifier
getTargetReplacementIdentifier
setTarget
getTarget
setTargetReference
setRules
addRules
getRules
getRule
clearRules
setFilterRule
addFilterRule
setStaticRule
setStaticRuleReference
filter
_normalizeSpec
_getRule

Description

Filter chain for string inflection

Properties

$_pluginLoader

Zend_Loader_PluginLoader_Interface $_pluginLoader = 'null'

Details

$_pluginLoader
Zend_Loader_PluginLoader_Interface
visibility
protected
default
null
final
false
static
false

$_rules

array $_rules = 'array'

Details

$_rules
array
visibility
protected
default
array
final
false
static
false

$_target

string $_target = 'null'

Details

$_target
string
visibility
protected
default
null
final
false
static
false

$_targetReplacementIdentifier

string $_targetReplacementIdentifier = ':'

Details

$_targetReplacementIdentifier
string
visibility
protected
default
:
final
false
static
false

$_throwTargetExceptionsOn

bool $_throwTargetExceptionsOn = 'true'

Details

$_throwTargetExceptionsOn
bool
visibility
protected
default
true
final
false
static
false

Methods

__construct

__construct( string|array $options = null ) :

Constructor

Arguments
$options
stringarray
Options to set
Details
visibility
public
final
false
static
false

_getRule

_getRule( string $rule ) : Zend_Filter_Interface

Resolve named filters and convert them to filter objects.

Arguments
$rule
string
Details
visibility
protected
final
false
static
false

_normalizeSpec

_normalizeSpec( string $spec ) : string

Normalize spec string

Arguments
$spec
string
Output
string
Details
visibility
protected
final
false
static
false

addFilterPrefixPath

addFilterPrefixPath( string $prefix, string $path ) : Zend_Filter_Inflector

Convienence method to add prefix and path to PluginLoader

Arguments
$prefix
string
$path
string
Details
visibility
public
final
false
static
false

addFilterRule

addFilterRule( mixed $spec, mixed $ruleSet ) : void

Add a filter rule for a spec

Arguments
$spec
mixed
$ruleSet
mixed
Details
visibility
public
final
false
static
false

addRules

addRules(  $rules ) : Zend_Filter_Inflector

AddRules(): multi-call to setting filter rules.

If prefixed with a ":" (colon), a filter rule will be added. If not prefixed, a static replacement will be added.

ex: array( ':controller' => array('CamelCaseToUnderscore','StringToLower'), ':action' => array('CamelCaseToUnderscore','StringToLower'), 'suffix' => 'phtml' );

Arguments
$rules
array
Details
visibility
public
final
false
static
false

clearRules

clearRules( ) : Zend_Filter_Inflector

ClearRules() clears the rules currently in the inflector

Details
visibility
public
final
false
static
false

filter

filter( string|array $source ) : string

Inflect

Arguments
$source
stringarray
Output
string
Details
visibility
public
final
false
static
false

getPluginLoader

getPluginLoader( ) : Zend_Loader_PluginLoader_Interface

Retreive PluginLoader

Details
visibility
public
final
false
static
false

getRule

getRule( string $spec, int $index ) : Zend_Filter_Interface|false

getRule() returns a rule set by setFilterRule(), a numeric index must be provided

Arguments
$spec
string
$index
int
Output
Zend_Filter_Interface|false
Details
visibility
public
final
false
static
false

getRules

getRules( string $spec = null ) : array|false

Get rules

By default, returns all rules. If a $spec is provided, will return those rules if found, false otherwise.

Arguments
$spec
string
Output
array|false
Details
visibility
public
final
false
static
false

getTarget

getTarget( ) : string

Retrieve target

Output
string
Details
visibility
public
final
false
static
false

getTargetReplacementIdentifier

getTargetReplacementIdentifier( ) : string

Get Target Replacement Identifier

Output
string
Details
visibility
public
final
false
static
false

isThrowTargetExceptionsOn

isThrowTargetExceptionsOn( ) : bool

Will exceptions be thrown?

Output
bool
Details
visibility
public
final
false
static
false

setConfig

setConfig( Zend_Config $config ) : Zend_Filter_Inflector

Use Zend_Config object to set object state

Arguments
$config
Zend_Config
Details
visibility
public
final
false
static
false
deprecated
Use setOptions() instead

setFilterRule

setFilterRule( string $spec, array|string|Zend_Filter_Interface $ruleSet ) : Zend_Filter_Inflector

Set a filtering rule for a spec. $ruleSet can be a string, Filter object or an array of strings or filter objects.

Arguments
$spec
string
$ruleSet
arraystringZend_Filter_Interface
Details
visibility
public
final
false
static
false

setOptions

setOptions( array $options ) : Zend_Filter_Inflector

Set options

Arguments
$options
array
Details
visibility
public
final
false
static
false

setPluginLoader

setPluginLoader( Zend_Loader_PluginLoader_Interface $pluginLoader ) : Zend_Filter_Inflector

Set PluginLoader

Arguments
$pluginLoader
Zend_Loader_PluginLoader_Interface
Details
visibility
public
final
false
static
false

setRules

setRules( array $rules ) : Zend_Filter_Inflector

SetRules() is the same as calling addRules() with the exception that it clears the rules before adding them.

Arguments
$rules
array
Details
visibility
public
final
false
static
false

setStaticRule

setStaticRule( string $name, string $value ) : Zend_Filter_Inflector

Set a static rule for a spec. This is a single string value

Arguments
$name
string
$value
string
Details
visibility
public
final
false
static
false

setStaticRuleReference

setStaticRuleReference( string $name, mixed $reference ) : Zend_Filter_Inflector

Set Static Rule Reference.

This allows a consuming class to pass a property or variable in to be referenced when its time to build the output string from the target.

Arguments
$name
string
$reference
mixed
Details
visibility
public
final
false
static
false

setTarget

setTarget(  $target ) : Zend_Filter_Inflector

Set a Target ex: 'scripts/:controller/:action.:suffix'

Arguments
$target
string
Details
visibility
public
final
false
static
false

setTargetReference

setTargetReference( reference $target ) : Zend_Filter_Inflector

Set Target Reference

Arguments
$target
reference
Details
visibility
public
final
false
static
false

setTargetReplacementIdentifier

setTargetReplacementIdentifier( string $targetReplacementIdentifier ) : Zend_Filter_Inflector

Set the Target Replacement Identifier, by default ':'

Arguments
$targetReplacementIdentifier
string
Details
visibility
public
final
false
static
false

setThrowTargetExceptionsOn

setThrowTargetExceptionsOn(  $throwTargetExceptionsOn ) : Zend_Filter_Inflector

Set Whether or not the inflector should throw an exception when a replacement identifier is still found within an inflected target.

Arguments
$throwTargetExceptionsOn
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.