Filter chain for string inflection
Constructor
| Parameters: | string|array|Traversable – Options to set |
|---|
Retrieve plugin manager
| Return type: | FilterPluginManager |
|---|
Set plugin manager
| Parameters: | FilterPluginManager – |
|---|---|
| Return type: | Inflector |
Set options
| Parameters: | array|Traversable – |
|---|---|
| Return type: | Inflector |
Set Whether or not the inflector should throw an exception when a replacement identifier is still found within an inflected target.
| Parameters: | bool – |
|---|---|
| Return type: | Inflector |
Will exceptions be thrown?
| Return type: | bool |
|---|
Set the Target Replacement Identifier, by default ‘:’
| Parameters: | string – |
|---|---|
| Return type: | Inflector |
Get Target Replacement Identifier
| Return type: | string |
|---|
Set a Target ex: ‘scripts/:controller/:action.:suffix’
| Parameters: | string – |
|---|---|
| Return type: | Inflector |
Set Target Reference
| Parameters: | reference – |
|---|---|
| Return type: | Inflector |
SetRules() is the same as calling addRules() with the exception that it clears the rules before adding them.
| Parameters: | array – |
|---|---|
| Return type: | 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’ );
| Parameters: | array – |
|---|---|
| Return type: | Inflector |
Get rules
By default, returns all rules. If a $spec is provided, will return those rules if found, false otherwise.
| Parameters: | string – |
|---|---|
| Return type: | array|false |
getRule() returns a rule set by setFilterRule(), a numeric index must be provided
| Parameters: |
|
|---|---|
| Return type: | FilterInterface|false |
ClearRules() clears the rules currently in the inflector
| Return type: | Inflector |
|---|
Set a filtering rule for a spec. $ruleSet can be a string, Filter object or an array of strings or filter objects.
| Parameters: |
|
|---|---|
| Return type: | Inflector |
Add a filter rule for a spec
| Parameters: |
|
|---|---|
| Return type: | Inflector |
Set a static rule for a spec. This is a single string value
| Parameters: |
|
|---|---|
| Return type: | 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.
| Parameters: |
|
|---|---|
| Return type: | Inflector |
Inflect
| Parameters: | string|array – |
|---|---|
| Throws ExceptionRuntimeException: | |
| Return type: | string |