Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (25 sloc) 1016 Bytes

ci-sitemap library

A simple sitemap generator for CodeIgniter.


To install just copy/paste the content of ci-sitemap in your application folder.


public function sitemap()
    // first load the library

    // create new instance
    $sitemap = new Sitemap();

    // add items to your sitemap (url, date, priority, freq)
    $sitemap->add('http://mysite.tld/', '2012-08-25T20:10:00+02:00', '1.0', 'daily');
    $sitemap->add('http://mysite.tld/page1', '2012-08-26T22:30:00+02:00', '0.6', 'monthly');
    $sitemap->add('http://mysite.tld/page2', '2012-08-26T23:45:00+02:00', '0.9', 'weekly');

    // add multiple items with a loop
    foreach ($posts as $post)
        $sitemap->add($post->slug, $post->date, $post->priority, $post->freq);

    // show your sitemap (options: 'xml', 'google-news', 'sitemapindex' 'html', 'txt', 'ror-rss', 'ror-rdf')
You can’t perform that action at this time.