PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Using Zend_Config with Zend_Filter_Inflector

You can use Zend_Config to set rules, filter prefix paths, and other object state in your inflectors, either by passing a Zend_Config object to the constructor or setOptions(). The following settings may be specified:

  • target specifies the inflection target.

  • filterPrefixPath specifies one or more filter prefix and path pairs for use with the inflector.

  • throwTargetExceptionsOn should be a boolean indicating whether or not to throw exceptions when a replacement identifier is still present after inflection.

  • targetReplacementIdentifier specifies the character to use when identifying replacement variables in the target string.

  • rules specifies an array of inflection rules; it should consist of keys that specify either values or arrays of values, consistent with addRules().

Example 440. Using Zend_Config with Zend_Filter_Inflector

<?php
// With the constructor:
$config    = new Zend_Config($options);
$inflector = new Zend_Filter_Inflector($config);

// Or with setOptions():
$inflector = new Zend_Filter_Inflector();
$inflector->setOptions($config);

Zend Framework