0

ここの誰かが助けてくれるのだろうか、私はZend Framework 2を始めたばかりで、プロジェクトを適切に開始するのは少し難しいと思います..

拡張できるベースコントローラーを作成しようとしています。現在、Zend Framework 2 スケルトン アプリケーションを使用しています。

vendor/zendframework/zendframework/library に Resources フォルダーを作成しました。Resources フォルダー内に、BaseController.php ファイルを格納する Controllers フォルダーがあります。

サイト全体で BaseController を使用できるように、プロジェクトで Resources フォルダーに BaseController を自動ロードするにはどうすればよいですか?

どんな助けでも大歓迎です。

ありがとう

4

1 に答える 1

0

You shouldn't need to create a base controller, ZF2 already provides a number of base controllers for you, such as the RestController and the AbstractActionController

http://framework.zend.com/manual/2.0/en/modules/zend.mvc.controllers.html

If you are going to create a base controller, create you own module and put it in the vendors directory.

You should never need to go into third party modules and modify code as you should be able to inherit and extend the classes that are provided by such libraries

于 2013-01-25T17:01:59.843 に答える