A simple sitemap generator for CodeIgniter
PHP
Switch branches/tags
Nothing to show
Clone or download
Damianoff updated Sitemap class
- ports from laravel-sitemap
Latest commit 726acf8 Jan 6, 2016
Permalink
Failed to load latest commit information.
libraries updated Sitemap class Jan 6, 2016
views/sitemap updated views Dec 6, 2015
.gitignore added .gitignore Dec 6, 2015
license.txt updated license Dec 4, 2015
readme.md updated readme Jan 6, 2016

readme.md

ci-sitemap library

A simple sitemap generator for CodeIgniter.

Installation

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

Example

public function sitemap()
{
    // first load the library
    $this->load->library('sitemap');

    // 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')
    $sitemap->render('xml');
}