Class Zend_Filter_Inflector

Description

Implements interfaces:

Filter chain for string inflection

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Filter/Inflector.php (line 41)


	
			
Variable Summary
Method Summary
 Zend_Filter_Inflector __construct ([string|array $options = null])
 Zend_Filter_Inflector addFilterPrefixPath (string $prefix, string $path)
 void addFilterRule (mixed $spec, mixed $ruleSet)
 string filter (string|array $source)
 Zend_Filter_Interface|false getRule (string $spec, int $index)
 array|false getRules ([string $spec = null])
 string getTarget ()
 Zend_Filter_Inflector setFilterRule (string $spec, array|string|Zend_Filter_Interface $ruleSet)
 Zend_Filter_Inflector setOptions (array $options)
 Zend_Filter_Inflector setStaticRule (string $name, string $value)
 Zend_Filter_Inflector setStaticRuleReference (string $name,  &$reference, mixed $reference)
 Zend_Filter_Inflector setTarget (string $target)
 Zend_Filter_Inflector setTargetReference ( &$target, reference $target)
 Zend_Filter_Inflector setTargetReplacementIdentifier (string $targetReplacementIdentifier)
 Zend_Filter_Inflector setThrowTargetExceptionsOn ( $throwTargetExceptionsOn, bool $throwTargetExceptions)
 string _normalizeSpec (string $spec)
Variables
Zend_Loader_PluginLoader_Interface $_pluginLoader = null (line 46)
  • access: protected
array $_rules = array() (line 66)
  • access: protected
string $_target = null (line 51)
  • access: protected
string $_targetReplacementIdentifier = ':' (line 61)
  • access: protected
bool $_throwTargetExceptionsOn = true (line 56)
  • access: protected
Methods
Constructor __construct (line 73)

Constructor

  • access: public
Zend_Filter_Inflector __construct ([string|array $options = null])
  • string|array $options: Options to set
addFilterPrefixPath (line 187)

Convienence method to add prefix and path to PluginLoader

  • access: public
Zend_Filter_Inflector addFilterPrefixPath (string $prefix, string $path)
  • string $prefix
  • string $path
addFilterRule (line 393)

Add a filter rule for a spec

  • access: public
void addFilterRule (mixed $spec, mixed $ruleSet)
  • mixed $spec
  • mixed $ruleSet
addRules (line 306)

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' );

  • access: public
Zend_Filter_Inflector addRules ( $rules)
  • array $rules
clearRules (line 365)

ClearRules() clears the rules currently in the inflector

  • access: public
Zend_Filter_Inflector clearRules ()
filter (line 455)

Inflect

  • access: public
string filter (string|array $source)
  • string|array $source

Implementation of:
Zend_Filter_Interface::filter()
Returns the result of filtering $value
getPluginLoader (line 108)

Retreive PluginLoader

  • access: public
getRule (line 349)

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

  • access: public
Zend_Filter_Interface|false getRule (string $spec, int $index)
  • string $spec
  • int $index
getRules (line 329)

Get rules

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

  • access: public
array|false getRules ([string $spec = null])
  • string $spec
getTarget (line 259)

Retrieve target

  • access: public
string getTarget ()
getTargetReplacementIdentifier (line 236)

Get Target Replacement Identifier

  • access: public
string getTargetReplacementIdentifier ()
isThrowTargetExceptionsOn (line 211)

Will exceptions be thrown?

  • access: public
bool isThrowTargetExceptionsOn ()
setConfig (line 136)

Use Zend_Config object to set object state

  • deprecated: Use setOptions() instead
  • access: public
Zend_Filter_Inflector setConfig ( $config)
setFilterRule (line 379)

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

  • access: public
Zend_Filter_Inflector setFilterRule (string $spec, array|string|Zend_Filter_Interface $ruleSet)
setOptions (line 147)

Set options

  • access: public
Zend_Filter_Inflector setOptions (array $options)
  • array $options
setPluginLoader (line 123)

Set PluginLoader

  • access: public
Zend_Filter_Inflector setPluginLoader ( $pluginLoader)
setRules (line 283)

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

  • access: public
Zend_Filter_Inflector setRules ( $rules)
  • array $rules
setStaticRule (line 424)

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

  • access: public
Zend_Filter_Inflector setStaticRule (string $name, string $value)
  • string $name
  • string $value
setStaticRuleReference (line 442)

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.

  • access: public
Zend_Filter_Inflector setStaticRuleReference (string $name,  &$reference, mixed $reference)
  • string $name
  • mixed $reference
  • &$reference
setTarget (line 248)

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

  • access: public
Zend_Filter_Inflector setTarget (string $target)
  • string $target
setTargetReference (line 270)

Set Target Reference

  • access: public
Zend_Filter_Inflector setTargetReference ( &$target, reference $target)
  • reference $target
  • &$target
setTargetReplacementIdentifier (line 222)

Set the Target Replacement Identifier, by default ':'

  • access: public
Zend_Filter_Inflector setTargetReplacementIdentifier (string $targetReplacementIdentifier)
  • string $targetReplacementIdentifier
setThrowTargetExceptionsOn (line 200)

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

  • access: public
Zend_Filter_Inflector setThrowTargetExceptionsOn ( $throwTargetExceptionsOn, bool $throwTargetExceptions)
  • bool $throwTargetExceptions
  • $throwTargetExceptionsOn
_getRule (line 510)

Resolve named filters and convert them to filter objects.

  • access: protected
Zend_Filter_Interface _getRule (string $rule)
  • string $rule
_normalizeSpec (line 499)

Normalize spec string

  • access: protected
string _normalizeSpec (string $spec)
  • string $spec

Documentation generated on Mon, 21 Jun 2010 15:28:58 -0400 by phpDocumentor 1.4.3