craft.request.getQuery() returns:
array (size=5)
'tags' => string 'anxiety' (length=7)
'maxPrice' => string '' (length=0)
'sessions' =>
array (size=4)
0 => string 'email' (length=5)
1 => string 'chat' (length=4)
2 => string 'skype' (length=5)
3 => string 'phone' (length=5)
'hours' =>
array (size=3)
0 => string 'office' (length=6)
1 => string 'evenings' (length=8)
2 => string 'weekends' (length=8)
Whereas craft.request.getParam() throws an error:
PHP warning
Missing argument 1 for Craft\HttpRequestVariable::getParam(), called in /home/vagrant/Sites/counselling-anywhere/craft/app/vendor/twig/twig/lib/Twig/Template.php on line 609 and defined
This should have changed in Build #2465 right? I'm assuming it'll still work the same, but it's confusing that they don't return the same results.
Is this by design?
request = craft.request.getParam()would require anif request.querybefore it returns any array (as @carlcs mentions, a single parameter array). Is this correct? I've asked this because there are a couple of the Stack Exchange examples, so assumed they were interchangeable. Are either preferable? The dot notation feels a bit cleaner to me. – Rob Feb 19 '16 at 18:39getQuery(). I think for many parameters it's a more succinct way of doing things. That release note was confusing me ;) – Rob Feb 19 '16 at 21:12