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 1


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.
    – DreiBaer
    Aug 24, 2016 at 20:34
  • @DreiBaer - In which case the issue will be with a different part of your code.
    – Lodder
    Aug 25, 2016 at 7:21
  • WHat do you mean with "case"? I have implemented it Component-File -> Controller (with constructor) -> View.
    – DreiBaer
    Aug 25, 2016 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.