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\self

Parameters

$spec

mixed

$ruleSet

mixed

Returns

\Zend\Filter\self

Multi-call to setting filter rules.

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

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

\Zend\Filter\self

Clears the rules currently in the inflector

clearRules() : \Zend\Filter\self

Returns

\Zend\Filter\self

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

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\self

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

Parameters

$spec

string

$ruleSet

arraystring\Zend\Filter\FilterInterface

Returns

\Zend\Filter\self

Set options

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

Parameters

$options

array\Traversable

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Returns

\Zend\Filter\self

Set plugin manager

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

Parameters

Returns

\Zend\Filter\self

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

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

Parameters

$rules

array

Returns

\Zend\Filter\self

Set a static rule for a spec.

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

This is a single string value

Parameters

$name

string

$value

string

Returns

\Zend\Filter\self

Set Static Rule Reference.

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

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

\Zend\Filter\self

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

setTarget(string $target) : \Zend\Filter\self

Parameters

$target

string

Returns

\Zend\Filter\self

Set Target Reference

setTargetReference(string $target) : \Zend\Filter\self

Parameters

$target

string

Returns

\Zend\Filter\self

Set the Target Replacement Identifier, by default ':'

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

Parameters

$targetReplacementIdentifier

string

Returns

\Zend\Filter\self

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\self

Parameters

$throwTargetExceptionsOn

bool

Returns

\Zend\Filter\self

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