Filter/Inflector.php
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.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Filter
- Version
- $Id$
Package: Zend_FilterFilter chain for string inflection
- Implements
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties
Methods
__construct(string | array $options = null) : void
ParametersName | Type | Description |
---|
$options | string | array | Options to set |
---|
_getRule(string $rule) : \Zend_Filter_Interface
Resolve named filters and convert them to filter objects.
ParametersName | Type | Description |
---|
$rule | string | |
---|
Returns addFilterPrefixPath(string $prefix, string $path) : \Zend_Filter_Inflector
Convienence method to add prefix and path to PluginLoader
ParametersName | Type | Description |
---|
$prefix | string | |
---|
$path | string | |
---|
Returns addFilterRule(mixed $spec, mixed $ruleSet) : void
Add a filter rule for a spec
ParametersName | Type | Description |
---|
$spec | mixed | |
---|
$ruleSet | mixed | |
---|
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'
);
ParametersName | Type | Description |
---|
$rules | | |
---|
ReturnsgetRule(string $spec, int $index) : \Zend_Filter_Interface | false
getRule() returns a rule set by setFilterRule(), a numeric index must be provided
ParametersName | Type | Description |
---|
$spec | string | |
---|
$index | int | |
---|
Returns setRules(array $rules) : \Zend_Filter_Inflector
SetRules() is the same as calling addRules() with the exception that it
clears the rules before adding them.
ParametersName | Type | Description |
---|
$rules | array | |
---|
Returns setStaticRule(string $name, string $value) : \Zend_Filter_Inflector
Set a static rule for a spec. This is a single string value
ParametersName | Type | Description |
---|
$name | string | |
---|
$value | string | |
---|
Returns 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.
ParametersName | Type | Description |
---|
$name | string | |
---|
$reference | mixed | |
---|
ReturnssetTarget( $target) : \Zend_Filter_Inflector
Set a Target
ex: 'scripts/:controller/:action.:suffix'
ParametersName | Type | Description |
---|
$target | | |
---|
Returns setTargetReplacementIdentifier(string $targetReplacementIdentifier) : \Zend_Filter_Inflector
Set the Target Replacement Identifier, by default ':'
ParametersName | Type | Description |
---|
$targetReplacementIdentifier | string | |
---|
Returns 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.
ParametersName | Type | Description |
---|
$throwTargetExceptionsOn | | |
---|
Returns