Filter chain for string inflection

 Methods

Constructor

__construct(string | array | \Traversable $options) 

Parameters

$options

stringarray\Traversable

Options to set

Invoke filter as a command

__invoke(mixed $value) : mixed
Inherited

Proxies to filter()

inherited_from \Zend\Filter\AbstractFilter::__invoke()

Parameters

$value

mixed

Exceptions

\Zend\Filter\Exception\ExceptionInterface If filtering $value is impossible

Returns

mixed

Add a filter rule for a spec

addFilterRule(mixed $spec, mixed $ruleSet) : \Zend\Filter\Inflector

Parameters

$spec

mixed

$ruleSet

mixed

Returns

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

addRules(array $rules) : \Zend\Filter\Inflector

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

$rules

array

Returns

ClearRules() clears the rules currently in the inflector

clearRules() : \Zend\Filter\Inflector

Inflect

filter(string | array $source) : string

Parameters

$source

stringarray

Exceptions

\Zend\Filter\Exception\RuntimeException

Returns

string

Retrieve options representing object state

getOptions() : array
Inherited

inherited_from \Zend\Filter\AbstractFilter::getOptions()

Returns

array

Retrieve plugin manager

getPluginManager() : \Zend\Filter\FilterPluginManager

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

getRule(string $spec, int $index) : \Zend\Filter\FilterInterface | false

Parameters

$spec

string

$index

int

Returns

Get rules

getRules(string $spec) : array | false

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

Parameters

$spec

string

Returns

arrayfalse

Retrieve target

getTarget() : string

Returns

string

Get Target Replacement Identifier

getTargetReplacementIdentifier() : string

Returns

string

hasPcreUnicodeSupport()

hasPcreUnicodeSupport() : bool
Inherited

inherited_from \Zend\Filter\AbstractFilter::hasPcreUnicodeSupport()

Returns

bool

Will exceptions be thrown?

isThrowTargetExceptionsOn() : bool

Returns

bool

Set a filtering rule for a spec.

setFilterRule(string $spec, array | string | \Zend\Filter\FilterInterface $ruleSet) : \Zend\Filter\Inflector

$ruleSet can be a string, Filter object or an array of strings or filter objects.

Parameters

$spec

string

$ruleSet

arraystring\Zend\Filter\FilterInterface

Returns

Set options

setOptions(array | \Traversable $options) : \Zend\Filter\Inflector

Parameters

$options

array\Traversable

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Returns

Set plugin manager

setPluginManager(\Zend\Filter\FilterPluginManager $manager) : \Zend\Filter\Inflector

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

setRules(array $rules) : \Zend\Filter\Inflector

Parameters

$rules

array

Returns

Set a static rule for a spec.

setStaticRule(string $name, string $value) : \Zend\Filter\Inflector

This is a single string value

Parameters

$name

string

$value

string

Returns

Set Static Rule Reference.

setStaticRuleReference(string $name, mixed $reference) : \Zend\Filter\Inflector

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

$name

string

$reference

mixed

Returns

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

setTarget($target) : \Zend\Filter\Inflector

Parameters

$target

string

Returns

Set Target Reference

setTargetReference(\Zend\Filter\reference $target) : \Zend\Filter\Inflector

Parameters

$target

\Zend\Filter\reference

Returns

Set the Target Replacement Identifier, by default ':'

setTargetReplacementIdentifier(string $targetReplacementIdentifier) : \Zend\Filter\Inflector

Parameters

$targetReplacementIdentifier

string

Returns

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

setThrowTargetExceptionsOn(bool $throwTargetExceptionsOn) : \Zend\Filter\Inflector

Parameters

$throwTargetExceptionsOn

bool

Returns

Resolve named filters and convert them to filter objects.

_getRule(string $rule) : \Zend\Filter\FilterInterface

Parameters

$rule

string

Returns

Normalize spec string

_normalizeSpec(string $spec) : string

Parameters

$spec

string

Returns

string

isOptions()

isOptions(mixed $options) : bool
Inherited

inherited_from \Zend\Filter\AbstractFilter::isOptions()

Parameters

$options

mixed

Returns

bool

 Properties

 

Filter options

$options : array
Inherited

inherited_from \Zend\Filter\AbstractFilter::$$options
 

$pluginManager

$pluginManager : \Zend\Filter\FilterPluginManager

 

$rules

$rules : array

 

$target

$target : string

 

$targetReplacementIdentifier

$targetReplacementIdentifier : string

 

$throwTargetExceptionsOn

$throwTargetExceptionsOn : bool