Php 在开发更大的网站时,如何组织包括、脚本?

Php 在开发更大的网站时,如何组织包括、脚本?,php,html,Php,Html,我一直在考虑在header.php文件中组织include、脚本、css等的最佳方法,我已经想出了一个解决方案,但我不知道这是否是好的。我想听听你在这件事上的技巧。 我在想这样的事情: PS:有更多的包含,但我不想淹没这个线程 <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-

我一直在考虑在header.php文件中组织include、脚本、css等的最佳方法,我已经想出了一个解决方案,但我不知道这是否是好的。我想听听你在这件事上的技巧。 我在想这样的事情: PS:有更多的包含,但我不想淹没这个线程

<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="scripts/bootstrap/bootstrap.js"></script>
<script src="scripts/jqplot/jquery.jqplot.min.js"></script>
<?php if($page_title == 'Home') echo'<script src="scripts/jqplot/jqplot.pieRenderer.min.js"></script>' ?>
<script src="scripts/global.js"></script>
<link rel="stylesheet" type="text/css" href="style/bootstrap/bootstrap.css">
<link rel="stylesheet" type="text/css" href="style/jqplot/jquery.jqplot.css">
<link rel="stylesheet" type="text/css" href="style/global.css">
<link rel="shortcut icon" href="images/logo_tab.png">
<title><?php echo $page_title; ?></title>
因此,我的主要想法是将大多数可选包含放在一个小php脚本中,该脚本将查看我们当前所在的页面,如果不需要该特定脚本,它将不会回显它。这是一个可行的解决方案吗?
谢谢

这将是实现这一目标的第一步。你曾经使用过Zend或Symfony等框架吗?不太可能,但我刚刚开始研究CodeIgniter,因为我的项目开始变得有点混乱。你应该试着深入研究这些框架,然后再提出一个你想要实现的具体问题。这些框架通常附带关于如何正确包含JS和CSS文件的工具。请查看Zend Framework 1.12,谢谢!我会调查的。