WebSite-PHP Framework PHP
Multi language
Simple Ajax mode
No HTML, no JavaScript
URL rewriting
Mail sending
Sitemap - RSS - Web service
Download WebSite-PHP FrameWork now
 


Loading
 


Simple SiteMap

Tutorials

>

Tutorial Sitemap

>

Simple SiteMap


Sitemap-01: Tutorial of the composant Sitemap of the PHP FrameWork WebSite-PHP.

Simple SiteMap:

<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
<url>
<loc>https://www.website-php.com/</loc>
<lastmod>2024-03-29</lastmod>
<changefreq>hourly</changefreq>
<priority>1</priority>
</url>

</urlset>



Go back to tutorial of the componant Sitemap



Source code

Source code


File: /pages/tutorials/sitemap/sitemap-01.php

<?php
// Use: http://YOUR_DOMAIN/tutorials/sitemap/sitemap-01.xml

class Sitemap01 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Simple SiteMap";
        
        
$sitemap = new GoogleSitemap();
        
$sitemap->addItem(
            new 
GoogleSitemapItem(
                
$this->getBaseURL(), 
                new 
DateTime(), 
                
GoogleSitemap::CHANGEFREQ_HOURLY"1"
            
)
        );
        
        
$this->render $sitemap;
    }
}
?>


Go back to tutorial of the componant Sitemap


Share

 


Copyright © 2009-2024 WebSite-PHP Framework PHP
Home Documentation Download Quick start Tutorials Wiki Issue Tracker