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.
Filter chain for string inflection
Zend_Loader_PluginLoader_Interface $_pluginLoader = 'null'
array $_rules = 'array'
string $_target = 'null'
string $_targetReplacementIdentifier = ':'
bool $_throwTargetExceptionsOn = 'true'
__construct(
string|array $options
=
null
)
:
Constructor
_getRule(
string $rule
)
:
Zend_Filter_Interface
Resolve named filters and convert them to filter objects.
_normalizeSpec(
string $spec
)
:
string
Normalize spec string
addFilterPrefixPath(
string $prefix, string $path
)
:
Zend_Filter_Inflector
Convienence method to add prefix and path to PluginLoader
addFilterRule(
mixed $spec, mixed $ruleSet
)
:
void
Add a filter rule for a spec
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' );
clearRules(
)
:
Zend_Filter_Inflector
ClearRules() clears the rules currently in the inflector
filter(
string|array $source
)
:
string
Inflect
getPluginLoader(
)
:
Zend_Loader_PluginLoader_Interface
Retreive PluginLoader
getRule(
string $spec, int $index
)
:
Zend_Filter_Interface|false
getRule() returns a rule set by setFilterRule(), a numeric index must be provided
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.
getTarget(
)
:
string
Retrieve target
getTargetReplacementIdentifier(
)
:
string
Get Target Replacement Identifier
isThrowTargetExceptionsOn(
)
:
bool
Will exceptions be thrown?
setConfig(
Zend_Config $config
)
:
Zend_Filter_Inflector
Use Zend_Config object to set object state
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.
setOptions(
array $options
)
:
Zend_Filter_Inflector
Set options
setPluginLoader(
Zend_Loader_PluginLoader_Interface $pluginLoader
)
:
Zend_Filter_Inflector
Set PluginLoader
setRules(
array $rules
)
:
Zend_Filter_Inflector
SetRules() is the same as calling addRules() with the exception that it clears the rules before adding them.
setStaticRule(
string $name, string $value
)
:
Zend_Filter_Inflector
Set a static rule for a spec. This is a single string value
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.
setTarget(
$target
)
:
Zend_Filter_Inflector
Set a Target ex: 'scripts/:controller/:action.:suffix'
setTargetReference(
reference $target
)
:
Zend_Filter_Inflector
Set Target Reference
setTargetReplacementIdentifier(
string $targetReplacementIdentifier
)
:
Zend_Filter_Inflector
Set the Target Replacement Identifier, by default ':'
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.