Skip to content

Instantly share code, notes, and snippets.

@onishiweb
Created March 27, 2014 17:09
Show Gist options
  • Save onishiweb/9812753 to your computer and use it in GitHub Desktop.
Save onishiweb/9812753 to your computer and use it in GitHub Desktop.
<?php
// In a file somewhere that you include (functions etc)
function switch_wrapper( $clause )
{
switch ($clause)
{
case 'foo':
echo "Foo was here!";
break;
case 'bar':
echo "To the bar!";
break;
default:
echo "Something witty...";
break;
}
}
// In your template
?>
<p><?php switch_wrapper( 'foo' ); ?></p>
<p><?php switch_wrapper( 'bar' ); ?></p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment