Get query string param that has no value Is it possible to determine whether or not a query string has a param with no value. For example

http://www.test.com?myparam


Technically that's a valid url but the craft.request object doesn't appear to have a way to see that. craft.request.getParam('myparam') returns nothing as does craft.request.getQuery('myparam'). I have tried using an explicit test for 'true' and 'false' but no luck.

Right now I'm grabbing the entire query string value and then using the 'in' to find the param name but thats pretty fragile is another param or value contains the same string.
A parameter with no value set returns an empty string '' for craft.request.getParam(). But if the whole parameter is not included at all, it returns null.

This means you can test for null (→ see Twig docs) like so:

{% if craft.request.getParam('myparam') is not null %}
    My Parameter is included in the query string!
{% endif %}