Skip to content

Instantly share code, notes, and snippets.

@jackmcdade
Created March 4, 2016 22:05
Show Gist options
  • Save jackmcdade/6754a2d7b2deefce8afd to your computer and use it in GitHub Desktop.
Save jackmcdade/6754a2d7b2deefce8afd to your computer and use it in GitHub Desktop.
<?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