Created
March 27, 2014 17:09
-
-
Save onishiweb/9812753 to your computer and use it in GitHub Desktop.
This file contains 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 | |
// 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