Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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.

share|improve this question
 
have you enabled your module on config file? –  André Gadonski Aug 8 at 12:46
 
yes, the module path and modules at always_load setting –  lukaserat Aug 9 at 0:04

2 Answers

up vote 1 down vote accepted

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. :)

share|improve this answer
 
It is a good solution, but I suggest you to use Theme instead of Views: they are better for modules. –  Marco Pace Aug 19 at 8:25
<?php

namespace Adm;


class Controller_Adm extends \Controller {

    public static function action_index() {
       return \Response::forge(\View::forge('adm::adm/index'));
    }

}

a estrutara de pastas é assim:

app
-modules
--adm
---classes
----controller
----model
----views -> viewsModels
---views -> views templates, páginas, html, etc
----adm
-----index.php

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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