简体   繁体   English

为什么要在PHP或Javascript上使用Dreamweaver模板进行模板制作?

[英]Why would one use Dreamweaver Templates over PHP or Javascript for templating?

I'm a student programmer for a company, and the lead developer is making a huge push to use Dreamweaver templates for our new site with vague reasoning pointing to performance benefits. 我是一家公司的学生程序员,主要开发人员正在大力推动在我们的新站点中使用Dreamweaver模板,而模糊的推理指出了性能优势。

I'm not convinced…why would one use Dreamweaver templates over a PHP or a Javascript template engine? 我不相信……为什么要在PHP或Javascript模板引擎上使用Dreamweaver模板? Especially since we're still using a LAMP stack for pulling in dynamic content. 特别是由于我们仍在使用LAMP堆栈来提取动态内容。

So: What are the benefits of using Dreamweaver templates for our site pages, and why would one use them over PHP or Javascript? 因此:在我们的网站页面上使用Dreamweaver模板有什么好处,为什么人们会在PHP或Javascript上使用它们?

You'd use DW templates if you were building a purely static website with no interaction beyond following links. 如果您要构建一个纯静态的网站,并且除了下面的链接之外没有其他交互作用,则可以使用DW模板。 The template will allow you to make changes to the page layout, and all your pages will be updated to reflect the changes you made. 该模板将允许您更改页面布局,并且所有页面都将更新以反映所做的更改。 You will have to reupload every page that uses the template in question, however. 但是,您将必须重新上传使用该模板的每个页面。

As soon as you need more interactivity than simple navigation, or need to present data that changes over time, you've gone beyond the scope of what a DW template can reasonably do. 一旦您需要比简单导航更多的交互性,或者需要显示随时间变化的数据,那么您已经超出了DW模板可以合理地进行的范围。 When you get to that stage, you'll need some kind of server-side scripting language (PHP, Perl, Python, something beginning with P :) ) 进入这一阶段时,您将需要某种服务器端脚本语言(PHP,Perl,Python,以P开头的东西:))

It sounds awfully like someone in management has heard that DW has templates and has latched onto that idea without really understanding what templates really are. 听起来好像管理层中有人听说DW有模板,并且在不真正了解模板是什么的情况下就牢牢抓住了这个想法。 Whilst it can be argued that they can improve performance in certain circumstances (a non-scripted web page will consume fewer server resources to run than a PHP script, for example), they aren't really suited to maintaining big sites, especially not if said sites require more interactivity/data presentation than DW templates can offer. 可以争论的是,它们可以在某些情况下提高性能(例如,非脚本化的网页将比PHP脚本消耗更少的服务器资源来运行),但它们实际上并不适合维护大型网站,尤其是如果所述站点需要比DW模板所能提供的更多的交互性/数据表示。

Dreamweaver templates are just unusable for the dynamic site. Dreamweaver模板仅可用于动态站点。 You can't, for example, create a template to print out 10 recent news titles. 例如,您不能创建模板来打印10个最近的新闻标题。 You need some server-side engine for this. 为此,您需要一些服务器端引擎。

JS is not the way to go too. JS也不可行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM