Search code examples
viewmodulefuelphp

Fuelphp: Can't load module's view from module's controller


Hi There need assistance here(specially those fuelphp developers),

I'm having these set-up on the fuelphp where I am using a module implementation. Below is my current set-up:

app
-modules
--design
---classes
---views
----admin
-----index.php

On my controller Controller_Admin I'm putting the code:

   $this->template->notification = \View::forge('common/notification.php');

It cause an error:

The requested view could not be found: common/notification.php

How can I load a view from my controller on my module? Any thoughts. Thank you.


Solution

  • I recently figured it out. I need to use the scope resolution (::) on this. :-) It works, I replaced my code to this:

    $this->template->notification = \View::forge('design::common/notification');
    

    Removing the extension and adding the module name with scope resolution solves the problem. :)