2

I am trying to include a module in Phalcon Micro Application. Is that possible?

I have a structure like this

common/
    components/
      ...
    modules/
       system
          components
             ...
          controllers
             ...
       rest
          components
             ...
          controllers
             ...
       www
          controllers
             ...
www/
   index.php -> Loads /Phalcon/Mvc/Application($di);

api/
   index.php -> Loads /Phalcon/Mvc/Micro($di);

The www registers the modules from config

I want the api to register the rest module from config and include the controllers and the components of that module. Is that possible?

Thanks, Gasim

4

2 に答える 2

1

Phalcon Micro Application にモジュールを含めようとしています。それは可能ですか?

はい、問題ありません!

API が構成から残りのモジュールを登録し、そのモジュールのコントローラーとコンポーネントを含めるようにします。それは可能ですか?

あなたの説明と構造を見て、www モジュールと api モジュールの構成を分離したいので、私はそれを理解しています。これは問題なく動作し、API 構成を www/index.php に含めるだけで済みます (ここがアプリケーションの開始場所であり、すべてのリクエストが送信される場所であるため)。幸運を!

于 2013-09-05T08:35:54.860 に答える