Skip to content

Instantly share code, notes, and snippets.

@danielwrobert
Created June 13, 2012 03:40
Show Gist options
  • Save danielwrobert/2921698 to your computer and use it in GitHub Desktop.
Save danielwrobert/2921698 to your computer and use it in GitHub Desktop.
A simple way to add a body class dynamically by removing the .php extension and echoing the name of the file.
<body class="<?=basename($_SERVER['PHP_SELF'],'.php')?>">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment