function sitemap() { $sitemap = array(array('loc' => site_url(), 'lastmod' => '', 'changefreq' => 'hourly', 'priority' => '0.8'), array('loc' => site_url('reader/list'), 'lastmod' => '', 'changefreq' => 'weekly', 'priority' => '0.5')); $comics = new Comic(); $comics->get_iterated(); foreach ($comics as $comic) { $sitemap[] = array('loc' => $comic->href(), 'lastmod' => '', 'changefreq' => 'daily', 'priority' => '0.4'); } $chapters = new Chapter(); $chapters->get_iterated(); foreach ($chapters as $chapter) { $sitemap[] = array('loc' => $chapter->href(), 'lastmod' => $chapter->created, 'changefreq' => 'daily', 'priority' => '0.4'); } $data["sitemap"] = $sitemap; $this->load->view('sitemap', $data); }