Where to put custom functions in Zend Framework 1.10

我与影子孤独终老i 提交于 2019-12-06 11:26:24

The objects you describe belong to the Model, so they go in application/models. Remember that the Model is everything that is not pertaining to the presentation layer (e.g. the V and C in MVC). My suggestion would be to have this structure then:

application
- models
-- my            -> to indicate this is yours
--- persistence  -> contains all classes that capsulte Data access logic
--- domain       -> business objects in your domain of application
--- service      -> services that use the domain objects or the persistence layer
--- mappers      -> your ORM layer (unless you are not using Doctrine anyway)

If you have classes that are generic enough to be reused in other applications, you can place them into the /lib folder. But everything specifically made for your app should go in models.

Also, have a look at the ZFPlanet Sample Project by Padraic Brady

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!