分离用户界面和PHP代码中的业务逻辑 [英] Separating UI & Business logic in PHP code

查看:123
本文介绍了分离用户界面和PHP代码中的业务逻辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在编写一个PHP项目.从本质上来说,该项目预计将运行很长时间,因此将经历一系列的主要和次要修改.像MVC架构一样,我想在项目中分别分解UI元素和业务逻辑,以使维护变得更加容易.同时,我不想遵循面向对象的方法.有人可以指导我如何在非面向对象的环境中实现UI和逻辑的这种分离吗?

在此先谢谢您.

Hi,

I''m coding a PHP project. The project, by its very nature, is expected to run for a long time & thereby will go through a series of major & minor modifications. Like MVC architecture, I want to disintegrate UI elements & business logic separate in the project so that the maintenance becomes easier. At the same time, I don''t want to follow object oriented approach. Can anybody guide me how to achieve this separation of UI & logic in a non object oriented environment?

Thanks in advance.

推荐答案

您可以将单独的文件放入业务逻辑中,并将它们放在单独的文件夹中,并在UI上可以包含这些文件
You can make separate files fir Business logic and put them in a separate folder and on UI you can include those files


这篇关于分离用户界面和PHP代码中的业务逻辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆