我有相当复杂的 HTML 文件, 需要生成窗体的 HTML 文件
一个带有多种 HTML 模板版位的体体。 简而言之, 我大概有一个 PHP 函数( 让我们假装这个域是新闻文章, 因为最简单) 类似
generateNewsBlob($title, $author, $imageSrc)
showUserInfo($userInfoStruct)
//etc.
以在模板中填充参数的方式输出 HTML。
At minimum I just want a nice folder with easy to edit PHP and easy to edit HTML and CSS. As of now I have it all smooshed together in a .php file - something like
lots of HTML <img src=" . $imgSrc . " > more HTML ...
which makes it very hard for our designer to make modifications and our coder (that d be me) to make modifications. So I need this to be decoupled. But I m not sure how to have a pure html file that has "holes" to be filled in by the php, because I would implement those holes in PHP... catch-22.
先前的一个SO问题中曾指出,MVC是实现这一目标的途径。这听起来令人难以置信,但我不知道该如何去做。我无法引进任何IDE - 开发者应该能够在主控台的文本编辑器中进行这项工作。
Python 和 Java 也是选项 如果它们碰巧是"更好"的话。