Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Calling global presenter from a module...
  • I split my app to 3 parts: public as main (global) application, admin and users as modules. In some cases I want to reuse global (common) code in my modules and I use presenters for some parts of template (widgets).

    So, when I try to reuse my global widget in admin module:

    $presenter = \Presenter::forge('widgets', 'do_lang_switcher', false, 'widgets/lang_switcher');

    I've got an error:

    Call to undefined method Admin\Presenter_Widgets::do_lang_switcher().

    Why global widget called in module namespace context? How to force run it in global namespace?
  • HarroHarro
    Accepted Answer
    Can you post the trace at the bottom of the error page, so I can see what triggers the error?

    Also, which Fuel version are you on?
  • Never mind. I already copied code of 'do_lang_switch()' method to modular widgets class.
    Thank you for attention.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion