1

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

5
  • Where are you calling it, from an URL, or another function? Dec 13, 2016 at 13:44
  • @PieroMarsilio From a URL 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. Dec 13, 2016 at 13:48
  • Just looking for less idiosyncratic ways to do things than classic Joomla. ^^ 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
    Jan 20, 2017 at 6:37

1 Answer 1

2

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 that you have read and understand our privacy policy and code of conduct.

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