[英]Html theme for every page
我正在为我的php
项目创建一个主题。 我想通过创建一个简单的theme.html
页面来减少代码量,并将其包含在每个页面中。
你能帮我吗?
示例theme.html
:
<html>
<body>
<h1>Welcome to panel</h1>
<ul>
<li><a class="home" href="#">Home</a></li>
<li><a class="about" href="#">About us</a></li>
<li><a class="contact" href="#">Contact us</a></li>
</ul>
<!-- content -->
<div class="content"><!-- other page codes will write here --></div>
<!-- content -->
</body>
<html>
现在,我想将此代码包括到index.html
并将表单代码写入到内容div? 帮我...
您可以使用php来做到这一点,因为您必须将.php
类的.php
文件保存index.html into index.php
然后包含如下文件
<?php include 'theme.php';?>
您还可以使用twig ,它是php的出色模板管理器(最初是为Symfony制作的),非常易于使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.