Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Zend框架2包括_Php_Zend Framework_Zend Framework2 - Fatal编程技术网

Php Zend框架2包括

Php Zend框架2包括,php,zend-framework,zend-framework2,Php,Zend Framework,Zend Framework2,我使用的php模块在视图中使用include语句。如何使用MVC模型包含此文件?我目前的结构如下所示。我想包括模型中的Foo文件。以前,所有文件都在同一个文件夹中,引用的视图包括_oncefoo.php。我尝试了几种不同的路径来引用foo文件,但到目前为止没有成功 Calendar Controller Model Foo Form View calendar calendar index 多谢各位 M我曾经通过co

我使用的php模块在视图中使用include语句。如何使用MVC模型包含此文件?我目前的结构如下所示。我想包括模型中的Foo文件。以前,所有文件都在同一个文件夹中,引用的视图包括_oncefoo.php。我尝试了几种不同的路径来引用foo文件,但到目前为止没有成功

Calendar
   Controller
   Model
     Foo
   Form
   View
     calendar
       calendar
         index 
多谢各位
M

我曾经通过composer将tcpdf包含在我的应用程序中。你可以在这里找到。我没有将此作为答案发布,因为目前还不清楚这是什么类型的模块,也不清楚您获取itcomposer、普通downlaod解压等的方式。
//use this 
include realpath(__DIR__.'/../../../Model/Foo.php');

//The first .. moves you to parent directory of index file (View->calendar->calendar)
//The second .. gets you to the parent directory of caldendar direcory(View->calendar)
//The third .. gets you to the parent directory of View directory
//from here you can move to Model directory
//I hope it helps