开发者

Zend > Access library from a module controller

i have be开发者_如何学JAVAen using a modular structure for my zend framework application.

This is my sample project hierarchy:

  • application

    • modules

      • v1
        • controllers
          • SampleController.php
        • models
        • views
        • configs
          • module.ini
    • configs

      • application.xml
  • library
    • My
      • Math
        • File.php

I want to access the library class file: "File.php" inside my module controller: "SampleController.php".

I tried instantiating it from my controller like this:

$sample = new My_Math_File();

But i got an error like this:

Fatal error: Class 'My_Math_File' not found in E:\zend\Apache2\htdocs\project\application\modules\v1\controllers\SampleController.php

Could not undserstand how to access the library resources from my module controller.


make sure to add autoloaderNamespaces[] = "My" to your application.ini and 99% this would solve it

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜