本文介紹了正確分離 PHP 中的邏輯/樣式的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
我只是想知道在 PHP Web 項目中將邏輯組件與布局分開的最??佳方法是什么?
I'm just wondering what is the best way to separate logic components from the layout in a PHP web project?
內容存儲在MySQL中,邏輯是PHP,模板當然是HTML/CSS.我的問題是,如何最好地解決這個問題(不使用 CMS).
The content is stored in MySQL, the logic is PHP and the templates are HTML/CSS of course. My question is, how to solve this issue best (without using a CMS).
greetz, poescholn
greetz, poeschlorn
推薦答案
使用 模板引擎,例如Smarty.
或者只使用帶有嵌入式 php 的 HTML 作為模板,注意不要在模板中放入太多邏輯.
Alternatively just use HTML with embedded php for templates, just be careful not to put too much logic into the template.
這篇關于正確分離 PHP 中的邏輯/樣式的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!