Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/250.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.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 类facade将在我的目录MVC中的什么位置?_Php_Design Patterns_Facade - Fatal编程技术网

Php 类facade将在我的目录MVC中的什么位置?

Php 类facade将在我的目录MVC中的什么位置?,php,design-patterns,facade,Php,Design Patterns,Facade,我有一个与设计模式相关的问题,我正在用php开发一个MVC应用程序,但我不知道类facade将在哪里,如果我使用MVC模式,我认为facade必须在模型中,但我不知道???,将类facade放在哪里 **model** DeliveryDepartment.php DiscountDepartment.php OrderDepartment.php PizzaCallCenterFacade.php **view** **controller** 或者我把门面放在另一个文件夹里?如何使用MVC

我有一个与设计模式相关的问题,我正在用php开发一个MVC应用程序,但我不知道类facade将在哪里,如果我使用MVC模式,我认为facade必须在模型中,但我不知道???,将类facade放在哪里

**model**
DeliveryDepartment.php
DiscountDepartment.php
OrderDepartment.php
PizzaCallCenterFacade.php
**view**
**controller**
或者我把门面放在另一个文件夹里?如何使用MVC组织设计图案外观


感谢您的回答

我将创建一个名为组件的新目录。这就是我粘贴非模型视图或控制器的额外类的地方。如果是这样的话,可以叫它helper

**components**
facade.php 
**model**
DeliveryDepartment.php
DiscountDepartment.php
OrderDepartment.php
PizzaCallCenterFacade.php
**view**
**controller**

我将创建一个名为components的新目录。这就是我粘贴非模型视图或控制器的额外类的地方。如果是这样的话,可以叫它helper

**components**
facade.php 
**model**
DeliveryDepartment.php
DiscountDepartment.php
OrderDepartment.php
PizzaCallCenterFacade.php
**view**
**controller**

如果你说的是实现,那么这个类就必须和模型呆在一起,因为它“展示”了其他模型类。

如果你说的是实现,那么这个类就必须和模型呆在一起,因为它“展示”了其他模型类。

谢谢你的回答,如果我使用像zend这样的mvc框架,设计模式应该在helpers文件夹或其他文件夹中?谢谢回答,如果我使用像zend这样的mvc框架,设计模式应该在helpers文件夹或其他文件夹中?正确。创建立面是为了降低复杂性。它属于模型。@yegor256谢谢回答,如果我使用zend这样的mvc框架,设计模式应该在helpers文件夹或其他文件夹中?“设计模式”不是类,它们不能“在文件夹中”。也是一种设计模式,例如.correct。创建立面是为了降低复杂性。它属于模型。@yegor256谢谢回答,如果我使用zend这样的mvc框架,设计模式应该在helpers文件夹或其他文件夹中?“设计模式”不是类,它们不能“在文件夹中”。例如,也是一种设计模式。