Created
July 22, 2011 13:34
-
-
Save johndwells/1099465 to your computer and use it in GitHub Desktop.
A clever way to succinctly normalise a parameter passed to EE
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
// Found within the guts of Stash: https://github.com/croxton/Stash | |
// set default value in 2nd param passed to TMPL::fetch_param() | |
$my_param = (bool) preg_match('/1|on|yes|y/i', $this->EE->TMPL->fetch_param('my_param', 'yes')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment