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.

有帮助吗?

解决方案

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

其他提示

<?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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top