Created
March 4, 2016 22:05
-
-
Save jackmcdade/6754a2d7b2deefce8afd to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Modifier_sluggy | |
* Strips out comas and then replaces non-letter-characters in a variable with a separator | |
*/ | |
class Modifier_more_sluggy extends Modifier | |
{ | |
public function index($value, $parameters=array()) { | |
$separator = array_get($parameters, 0, '-'); | |
$value = str_replace(',', '', $value); | |
return Slug::make($value, array('separator' => $separator)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment