Is it possible to pass arguments to controller action methods, like

public function someAction($myArgument) { ... }

Or is using JInput the only way?

Edit: Using a URL like option=com_mycomponent&task=mycontroller.someaction&myargument=asd

  • Where are you calling it, from an URL, or another function? Commented Dec 13, 2016 at 13:44
  • @PieroMarsilio From a URL Commented Dec 13, 2016 at 13:44
  • well then I think only using JInput or a session variable previously stored. Maybe if you explain some more what do you want to achieve maybe we can help you out. Commented Dec 13, 2016 at 13:48
  • Just looking for less idiosyncratic ways to do things than classic Joomla. ^^ Commented Dec 13, 2016 at 13:53
  • You can override the execute method and add something like callBindedFunction at github.com/joomplace/JooYii/blob/master/Helper.php
    – Alexandr
    Commented Jan 20, 2017 at 6:37

1 Answer 1


No, there isn't a way to pass arguments into methods. Specifically, this has to do with how JControllerLegacy::execute() routes the request. So you're left with using the request or session to fetch your needed data.

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.