When calling the method $this->filterForm = JRequest::getVar('FilterForm');
, I get an empty result.
But checking the com_banners component on the same system shows a result. What can I do to get it working?
1 Answer
This is the way to retrieve an input:
$jinput = JFactory::getApplication()->input;
$this->filterForm = $jinput->get('FilterForm', 'default_value', 'filter');
TIP: Take into account that if your don't specify a default_value, it will return null when no value is detected. If your don't specify a filter, it will apply a strict filter, CMD, for commands (It allows a-z, 0-9, underscore, dot, dash. It also removes leading dots from result).
-
The result is still NULL (when I remove the 'filter' and the 'default_value'). I think, I have something completly wrong. Thats why I get no result.– DreiBaerAug 24, 2016 at 20:34
-
@DreiBaer - In which case the issue will be with a different part of your code.– LodderAug 25, 2016 at 7:21
-
WHat do you mean with "case"? I have implemented it Component-File -> Controller (with constructor) -> View.– DreiBaerAug 25, 2016 at 19:06
JRequest
is deprecated and soon to be removed. Please use this: docs.joomla.org/Retrieving_request_data_using_JInput