Created
June 27, 2012 18:23
-
-
Save SocalNick/3005860 to your computer and use it in GitHub Desktop.
ZF2 FilterChain Sample Configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Convert "socalnick.dev.phantom.www.ign.com" or "www.ign.com" to "WwwIgnCom" | |
$filter = new Zend\Filter\FilterChain(array( | |
'filters' => array( | |
array( | |
'name' => 'pregReplace', | |
'options' => array( | |
'match' => '/^(.*phantom\.)?([^:]+)(:\d+)?$/i', | |
'replace' => '$2', | |
), | |
), | |
array( | |
'name' => 'word\SeparatorToCamelCase', | |
'options' => array('.'), | |
), | |
), | |
)); | |
$siteModule = $filter->filter($_SERVER['SERVER_NAME']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment