Studyon Minte9.com
ZF 1.0




Inflector



You may find you need to transform MixedCase or camelCasedWords into a path; for readability, 
OS policies, or other reasons, you also need to lower case this, and you want to separate the words using a dash ('-'). 
An inflector can do this for you. 


#controller
<?php
...
$string = 'camel Cased Words';

// Zend_Filter
$filter = new Zend_Filter();
$filter->addFilter(new Zend_Filter_Word_SeparatorToDash())
	->addFilter(new Zend_Filter_StringToLower);
$filtered = $filter->filter($string);
$filtered = 'pages/' . $filtered . '.html';
	// pages/camel-cased-words.html

// Zend_Filter_Inflector
$inflector = new Zend_Filter_Inflector('pages/:page.:suffix');
$inflector->setRules(array(
	':page' => array('Word_SeparatorToDash', 'StringToLower'),
	'suffix' => 'html',
));

$filtered = $inflector->filter(array('page' => $string));
	// pages/camel-cased-words.html


http://framework.zend.com/manual/en/zend.filter.inflector.html