這是我們的文件夾結構:index.php-app/--app.php---template/----template.php----parts/-----head.php-----header.php-----body.php-----(etc)我基本上只是在每個文件中使用 include 來導入我的 html 模板。索引.php:<?php include ('app/app.php');?>應用程序.php:<?phpinclude ('template/template.php');?>模板/模板.php :<?php // Load our Headinclude ('parts/head.php');// Load our Headerinclude ('parts/header.php');// Load our Bodyinclude ('parts/body.php');// Load our Footerinclude ('parts/footer.php');?>每個 head.php、body.php 等...都有一個,<?php echo "test head" ?>但最后我的結果是一個空白的白頁。
PHP 文件包括 app.php > App 包括 template.php >
慕桂英3389331
2022-12-23 15:36:57