We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

$this->EE->TMPL->fetch_param changing "on" to "yes"

Development and Programming

Michael Witwicki's avatar
Michael Witwicki
115 posts
15 years ago
Michael Witwicki's avatar Michael Witwicki

Has anyone run into this before? In one of our modules we need to allow the end user to be able to set a particular class to any string they like. However, when the end user passes the string: “on” as the parameter, it appears that EE is switching it to “yes”. Has anyone run into this before? Is there a way to work around it?

       
Greg Aker's avatar
Greg Aker
6,022 posts
15 years ago
Greg Aker's avatar Greg Aker

It is by design. Look at the function’s source in the Template library. Specifically the docblock comment:

* Used by Modules to fetch a paramter for the tag currently be processed. We also have code * in here to convert legacy values like ‘y’ and ‘on’ to their more respectable full values. * Further, if one assigns the second argument, it will be returned as the value if a * parameter of the $which name does not exist for this tag. Handy for default values!

-greg

       
Michael Witwicki's avatar
Michael Witwicki
115 posts
15 years ago
Michael Witwicki's avatar Michael Witwicki

Ah! Thanks Greg. I gotta say that I do find this really limiting. I feel like the responsibility should be in the hands of the developer to make conversions like these. Seems odd that you could never actually pass a parameter of “on” and have it stay intact.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.