1

So when getting a module for rendering inside a component this is not working:

$mod = ModuleHelper::getModuleById(123);

but this:

$mod = ModuleHelper::getModuleById("123");

That's because inside Joomlas getModuleById function the type is declared to string:

if ((string) $modules[$i]->id === $id) {

Does that makes sence? Whats the purpose of that?

1
  • No purpose. It's just an example of code not being reviewed before being merged.
    – Sharky
    Mar 6 at 6:39

0

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.

Browse other questions tagged or ask your own question.