HTML Template File

前端 未结 6 696
梦毁少年i
梦毁少年i 2021-01-28 04:29

I know this is a beginner\'s question, but I\'ve been searching online and all I can find are \"free website templates\" that I can download.

The question is: How can I

6条回答
  •  情话喂你
    2021-01-28 04:54

    There are two places you can do this:

    1. Server side programming at runtime (which allows for quick updates to templates but needs server support)
    2. Something at build time (which simplifies cache control and doesn't require anything to run on the server)

    The two basic approaches to this are includes (simple) and full template systems (powerful).

    For a runtime include system, the popular choice is PHP's include function. An alternative is SSI. You can even use a C preprocessor.

    Template systems include PHP's Smarty.

    My weapon of choice is Template-Toolkit, which can be used via Perl at runtime and comes with ttree for use at build time.

    Less sane options involving making the client do it and include frames and JavaScript.

提交回复
热议问题