Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
__construct ($options=null) | |
getPluginLoader () | |
setPluginLoader (Zend_Loader_PluginLoader_Interface $pluginLoader) | |
setConfig (Zend_Config $config) | |
setOptions ($options) | |
addFilterPrefixPath ($prefix, $path) | |
setThrowTargetExceptionsOn ($throwTargetExceptionsOn) | |
isThrowTargetExceptionsOn () | |
setTargetReplacementIdentifier ($targetReplacementIdentifier) | |
getTargetReplacementIdentifier () | |
setTarget ($target) | |
getTarget () | |
setTargetReference (&$target) | |
setRules (Array $rules) | |
addRules (Array $rules) | |
getRules ($spec=null) | |
getRule ($spec, $index) | |
clearRules () | |
setFilterRule ($spec, $ruleSet) | |
addFilterRule ($spec, $ruleSet) | |
setStaticRule ($name, $value) | |
setStaticRuleReference ($name, &$reference) | |
filter ($source) | |
Protected Member Functions | |
_normalizeSpec ($spec) | |
_getRule ($rule) | |
Protected Attributes | |
$_pluginLoader = null | |
$_target = null | |
$_throwTargetExceptionsOn = true | |
$_targetReplacementIdentifier = ':' | |
$_rules = array() | |
Definition at line 41 of file Inflector.php.
__construct | ( | $options = null | ) |
Constructor
string | array | $options | Options to set |
Definition at line 73 of file Inflector.php.
|
protected |
Resolve named filters and convert them to filter objects.
string | $rule |
Definition at line 510 of file Inflector.php.
|
protected |
Normalize spec string
string | $spec |
Definition at line 499 of file Inflector.php.
addFilterPrefixPath | ( | $prefix, | |
$path | |||
) |
Convienence method to add prefix and path to PluginLoader
string | $prefix | |
string | $path |
Definition at line 187 of file Inflector.php.
addFilterRule | ( | $spec, | |
$ruleSet | |||
) |
Add a filter rule for a spec
mixed | $spec | |
mixed | $ruleSet |
Definition at line 393 of file Inflector.php.
addRules | ( | Array | $rules | ) |
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' );
array |
Definition at line 306 of file Inflector.php.
clearRules | ( | ) |
ClearRules() clears the rules currently in the inflector
Definition at line 365 of file Inflector.php.
filter | ( | $source | ) |
Inflect
string | array | $source |
Implements Zend_Filter_Interface.
Definition at line 455 of file Inflector.php.
getPluginLoader | ( | ) |
Retreive PluginLoader
Definition at line 108 of file Inflector.php.
getRule | ( | $spec, | |
$index | |||
) |
getRule() returns a rule set by setFilterRule(), a numeric index must be provided
string | $spec | |
int | $index |
Definition at line 349 of file Inflector.php.
getRules | ( | $spec = null | ) |
Get rules
By default, returns all rules. If a $spec is provided, will return those rules if found, false otherwise.
string | $spec |
Definition at line 329 of file Inflector.php.
getTarget | ( | ) |
getTargetReplacementIdentifier | ( | ) |
Get Target Replacement Identifier
Definition at line 236 of file Inflector.php.
isThrowTargetExceptionsOn | ( | ) |
Will exceptions be thrown?
Definition at line 211 of file Inflector.php.
setConfig | ( | Zend_Config | $config | ) |
Use Zend_Config object to set object state
Zend_Config | $config |
Definition at line 136 of file Inflector.php.
setFilterRule | ( | $spec, | |
$ruleSet | |||
) |
Set a filtering rule for a spec. $ruleSet can be a string, Filter object or an array of strings or filter objects.
string | $spec | |
array | string | Zend_Filter_Interface | $ruleSet |
Definition at line 379 of file Inflector.php.
setOptions | ( | $options | ) |
Set options
array | $options |
Definition at line 147 of file Inflector.php.
setPluginLoader | ( | Zend_Loader_PluginLoader_Interface | $pluginLoader | ) |
Set PluginLoader
Zend_Loader_PluginLoader_Interface | $pluginLoader |
Definition at line 123 of file Inflector.php.
setRules | ( | Array | $rules | ) |
SetRules() is the same as calling addRules() with the exception that it clears the rules before adding them.
array | $rules |
Definition at line 283 of file Inflector.php.
setStaticRule | ( | $name, | |
$value | |||
) |
Set a static rule for a spec. This is a single string value
string | $name | |
string | $value |
Definition at line 424 of file Inflector.php.
setStaticRuleReference | ( | $name, | |
& | $reference | ||
) |
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.
string | $name | |
mixed | $reference |
Definition at line 442 of file Inflector.php.
setTarget | ( | $target | ) |
Set a Target ex: 'scripts/:controller/:action.:suffix'
string |
Definition at line 248 of file Inflector.php.
setTargetReference | ( | & | $target | ) |
Set Target Reference
reference | $target |
Definition at line 270 of file Inflector.php.
setTargetReplacementIdentifier | ( | $targetReplacementIdentifier | ) |
Set the Target Replacement Identifier, by default ':'
string | $targetReplacementIdentifier |
Definition at line 222 of file Inflector.php.
setThrowTargetExceptionsOn | ( | $throwTargetExceptionsOn | ) |
Set Whether or not the inflector should throw an exception when a replacement identifier is still found within an inflected target.
bool | $throwTargetExceptions |
Definition at line 200 of file Inflector.php.
|
protected |
Definition at line 46 of file Inflector.php.
|
protected |
Definition at line 66 of file Inflector.php.
|
protected |
Definition at line 51 of file Inflector.php.
|
protected |
Definition at line 61 of file Inflector.php.
|
protected |
Definition at line 56 of file Inflector.php.