Created
February 13, 2014 17:09
-
-
Save chrisamoore/8979331 to your computer and use it in GitHub Desktop.
How can I make this Leaner ?
This file contains 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 | |
//TODO: MAke Gooder Codes here | |
public function convertToBundle($str) | |
{ | |
//$str = 'UE\Stampede\TestBundle\Controller\TestController::getTestsAction'; | |
/// find :: shift back to before controller | |
// strip action | |
$str = preg_replace('/Action/', '', $str); | |
$str = preg_replace('/::/', ':', $str); | |
$str = str_replace('\Controller\\', ':', $str); | |
$str = preg_replace('/Controller/', '', $str); | |
$str = str_replace('\\', '', $str); | |
return $str; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment