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