1
我想以下this答案笨 - 站點地圖錯誤
這裏創建我笨的應用程序的站點地圖是我的控制器方法:
public function siteMap() {
$this->load->helper('url');
$urls = array("test");
$data['urls'] = $urls;
$data['frontend'] = $this->getFronendItems();
$this->load->template('front/site_map.php', $data);
}
而我的觀點:
<?php header('Content-type: text/xml'); ?>
<?= '<?xml version="1.0" encoding="UTF-8" ?>' ?>
<url>
<loc><?= base_url() ?></loc>
<priority>1.0</priority>
</url>
<?php foreach($urls as $url) { ?>
<url>
<loc><?= base_url() . $url ?></loc>
<priority>0.5</priority>
</url>
<?php } ?>
這引起以下錯誤:
This page contains the following errors:
error on line 41 at column 8: Opening and ending tag mismatch: link line 0 and head
試圖刪除標題和URL只是呼應在屏幕上的字符串。我究竟做錯了什麼 ?
仍然收到相同的錯誤:(我使用模板,因爲我有共同的頁眉和頁腳的所有意見 – stackUnderflow
什麼是第41行第8列的頁面? – timothymarois