Fully Qualified Name: | Zend\Filter\Inflector |
Extends: | AbstractFilter |
Filter chain for string inflection
Name | Description | Defined By |
---|---|---|
__construct() | Constructor | Inflector |
__invoke() | Invoke filter as a command | AbstractFilter |
addFilterRule() | Add a filter rule for a spec | Inflector |
addRules() | Multi-call to setting filter rules. | Inflector |
clearRules() | Clears the rules currently in the inflector | Inflector |
filter() | Inflect | Inflector |
getOptions() | Retrieve options representing object state | AbstractFilter |
getPluginManager() | Retrieve plugin manager | Inflector |
getRule() | Returns a rule set by setFilterRule(), a numeric index must be provided | Inflector |
getRules() | Get rules | Inflector |
getTarget() | Retrieve target | Inflector |
getTargetReplacementIdentifier() | Get Target Replacement Identifier | Inflector |
hasPcreUnicodeSupport() | AbstractFilter | |
isThrowTargetExceptionsOn() | Will exceptions be thrown? | Inflector |
setFilterRule() | Set a filtering rule for a spec. $ruleSet can be a string, Filter object or an array of strings or filter objects. | Inflector |
setOptions() | Set options | Inflector |
setPluginManager() | Set plugin manager | Inflector |
setRules() | Is the same as calling addRules() with the exception that it clears the rules before adding them. | Inflector |
setStaticRule() | Set a static rule for a spec. This is a single string value | Inflector |
setStaticRuleReference() | Set Static Rule Reference. | Inflector |
setTarget() | Set a Target ex: 'scripts/:controller/:action.:suffix' | Inflector |
setTargetReference() | Set Target Reference | Inflector |
setTargetReplacementIdentifier() | Set the Target Replacement Identifier, by default ':' | Inflector |
setThrowTargetExceptionsOn() | Set Whether or not the inflector should throw an exception when a replacement identifier is still found within an inflected target. | Inflector |
Constructor
Parameter Name | Type | Description |
---|---|---|
$options | string|array|\Traversable | Options |
Returns:
Invoke filter as a command
Proxies to {@link filter()}
Parameter Name | Type | Description |
---|---|---|
$value | mixed |
Returns: mixed
Add a filter rule for a spec
Parameter Name | Type | Description |
---|---|---|
$spec | mixed | |
$ruleSet | mixed |
Returns: self
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'
);
Parameter Name | Type | Description |
---|---|---|
$rules | array |
Returns: self
Clears the rules currently in the inflector
Returns: self
Inflect
Parameter Name | Type | Description |
---|---|---|
$source | string|array |
Returns: string
Retrieve options representing object state
Returns: array
Retrieve plugin manager
Returns: \FilterPluginManager
Returns a rule set by setFilterRule(), a numeric index must be provided
Parameter Name | Type | Description |
---|---|---|
$spec | string | |
$index | int |
Returns: \FilterInterface|bool
Get rules
By default, returns all rules. If a $spec is provided, will return those rules if found, false otherwise.
Parameter Name | Type | Description |
---|---|---|
$spec | string |
Returns: array|bool
Retrieve target
Returns: string
Get Target Replacement Identifier
Returns: string
Returns: bool
Will exceptions be thrown?
Returns: bool
Set a filtering rule for a spec. $ruleSet can be a string, Filter object or an array of strings or filter objects.
Parameter Name | Type | Description |
---|---|---|
$spec | string | |
$ruleSet | array|string|\Zend\Filter\FilterInterface |
Returns: self
Set options
Parameter Name | Type | Description |
---|---|---|
$options | array|\Traversable |
Returns: self
Set plugin manager
Parameter Name | Type | Description |
---|---|---|
$manager | \FilterPluginManager |
Returns: self
Is the same as calling addRules() with the exception that it clears the rules before adding them.
Parameter Name | Type | Description |
---|---|---|
$rules | array |
Returns: self
Set a static rule for a spec. This is a single string value
Parameter Name | Type | Description |
---|---|---|
$name | string | |
$value | string |
Returns: self
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.
Parameter Name | Type | Description |
---|---|---|
$name | string | |
$reference | mixed |
Returns: self
Set a Target ex: 'scripts/:controller/:action.:suffix'
Parameter Name | Type | Description |
---|---|---|
$target | string |
Returns: self
Set Target Reference
Parameter Name | Type | Description |
---|---|---|
$target | string |
Returns: self
Set the Target Replacement Identifier, by default ':'
Parameter Name | Type | Description |
---|---|---|
$targetReplacementIdentifier | string |
Returns: self
Set Whether or not the inflector should throw an exception when a replacement identifier is still found within an inflected target.
Parameter Name | Type | Description |
---|---|---|
$throwTargetExceptionsOn | bool |
Returns: self