Skip to content

Instantly share code, notes, and snippets.

@jeremyboggs
Created January 26, 2012 00:53
Show Gist options
  • Save jeremyboggs/1680109 to your computer and use it in GitHub Desktop.
Save jeremyboggs/1680109 to your computer and use it in GitHub Desktop.
Creating a filter name based on text from a file's call back.
<?php
$filterName = Inflector::underscore($callback);
// Avoid creating a 'file_default_display_display' filter name.
if ($filterName == 'default_display') {
$filterName = 'file_'.$filterName;
} else {
$filterName = 'file_'.$filterName.'_display';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment